mirror of
https://github.com/love2d/love-android.git
synced 2026-08-21 13:09:40 +02:00
fixed loading of files from file managers
This commit is contained in:
@@ -35,6 +35,14 @@
|
||||
<data android:scheme="content" />
|
||||
<data android:mimeType="application/x-love-game" />
|
||||
</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>
|
||||
</application>
|
||||
|
||||
|
||||
@@ -17,8 +17,12 @@ public class GameLauncher extends GameActivity {
|
||||
protected void onCreate(Bundle bundle) {
|
||||
Uri game = this.getIntent().getData();
|
||||
if (game != null) {
|
||||
copyGameToCache (game);
|
||||
Log.d("GameLauncher", "Selected the file: " + getGamePath());
|
||||
if (game.getScheme().equals ("file")) {
|
||||
gamePath = game.getPath();
|
||||
} else {
|
||||
copyGameToCache (game);
|
||||
}
|
||||
Log.d("GameLauncher", "Selected the file: " + getGamePath());
|
||||
}
|
||||
super.onCreate(bundle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user