From 1de4c2e8c64a864b0fc0787d19e33b0d6a82f7ed Mon Sep 17 00:00:00 2001 From: hypnosis-i2p Date: Sun, 18 Feb 2018 00:25:58 +0800 Subject: [PATCH] perms prompt now doesn't show the back button - android --- android/AndroidManifest.xml | 1 + android/src/org/purplei2p/i2pd/I2PDPermsAskerActivity.java | 2 ++ .../src/org/purplei2p/i2pd/I2PDPermsExplanationActivity.java | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 92a252d9..cfc9d55b 100755 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -18,6 +18,7 @@ android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" + android:theme="@android:style/Theme.Holo.Light.DarkActionBar" > diff --git a/android/src/org/purplei2p/i2pd/I2PDPermsAskerActivity.java b/android/src/org/purplei2p/i2pd/I2PDPermsAskerActivity.java index 2506f703..251e2650 100644 --- a/android/src/org/purplei2p/i2pd/I2PDPermsAskerActivity.java +++ b/android/src/org/purplei2p/i2pd/I2PDPermsAskerActivity.java @@ -124,6 +124,8 @@ public class I2PDPermsAskerActivity extends Activity { ActivityCompat.requestPermissions(I2PDPermsAskerActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_WRITE_EXTERNAL_STORAGE); + } else { + finish(); //close the app } } } diff --git a/android/src/org/purplei2p/i2pd/I2PDPermsExplanationActivity.java b/android/src/org/purplei2p/i2pd/I2PDPermsExplanationActivity.java index 8ca3d425..d1641e78 100644 --- a/android/src/org/purplei2p/i2pd/I2PDPermsExplanationActivity.java +++ b/android/src/org/purplei2p/i2pd/I2PDPermsExplanationActivity.java @@ -1,5 +1,6 @@ package org.purplei2p.i2pd; +import android.app.ActionBar; import android.content.Intent; import android.os.Bundle; import android.app.Activity; @@ -12,7 +13,8 @@ public class I2PDPermsExplanationActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_perms_explanation); - //getActionBar().setDisplayHomeAsUpEnabled(true); + ActionBar actionBar = getActionBar(); + if(actionBar!=null)actionBar.setHomeButtonEnabled(false); Button button_ok = (Button) findViewById(R.id.button_ok); button_ok.setOnClickListener(new View.OnClickListener() { @Override