diff options
Diffstat (limited to 'android')
| -rw-r--r-- | android/AndroidManifest.xml | 1 | ||||
| -rw-r--r-- | android/src/com/ilotterytea/maxoning/AndroidLauncher.java | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 17e798b..344d39f 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -4,6 +4,7 @@ package="com.ilotterytea.maxoning"> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <application android:allowBackup="true" diff --git a/android/src/com/ilotterytea/maxoning/AndroidLauncher.java b/android/src/com/ilotterytea/maxoning/AndroidLauncher.java index f217cb9..e6d3551 100644 --- a/android/src/com/ilotterytea/maxoning/AndroidLauncher.java +++ b/android/src/com/ilotterytea/maxoning/AndroidLauncher.java @@ -1,5 +1,8 @@ package com.ilotterytea.maxoning; +import android.Manifest; +import android.content.pm.PackageManager; +import android.os.Build; import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; @@ -11,6 +14,14 @@ public class AndroidLauncher extends AndroidApplication { protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); + + // Granting the permissions: + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (this.checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + this.requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 100); + } + } + initialize(new MaxonGame(), config); } } |
