mirror of
https://github.com/love2d/love-android.git
synced 2026-08-20 04:31:26 +02:00
fixed loading of files from file managers
This commit is contained in:
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user