fixed loading of files from file managers

This commit is contained in:
fysx
2014-02-13 14:08:06 +01:00
parent 0db55463c9
commit 1703660617
2 changed files with 14 additions and 2 deletions
+8
View File
@@ -35,6 +35,14 @@
<data android:scheme="content" /> <data android:scheme="content" />
<data android:mimeType="application/x-love-game" /> <data android:mimeType="application/x-love-game" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.love" />
<data android:host="*" />
</intent-filter>
</activity> </activity>
</application> </application>
+6 -2
View File
@@ -17,8 +17,12 @@ public class GameLauncher extends GameActivity {
protected void onCreate(Bundle bundle) { protected void onCreate(Bundle bundle) {
Uri game = this.getIntent().getData(); Uri game = this.getIntent().getData();
if (game != null) { if (game != null) {
copyGameToCache (game); if (game.getScheme().equals ("file")) {
Log.d("GameLauncher", "Selected the file: " + getGamePath()); gamePath = game.getPath();
} else {
copyGameToCache (game);
}
Log.d("GameLauncher", "Selected the file: " + getGamePath());
} }
super.onCreate(bundle); super.onCreate(bundle);
} }