diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-06-12 20:02:57 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-06-12 20:02:57 +0200 |
commit | 8b669b51b9aacd0da0047979247386319e6c4536 (patch) | |
tree | 514371d91bfe8aad917b9c7d0df4e6dd22e98e63 /src/main/java/eu/siacs/conversations/ui/startUI.java | |
parent | 01c717753cfbcfa42a5982b55c1589dacb5065c1 (diff) |
also restart if permissions were changed after first start
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/startUI.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/startUI.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/startUI.java b/src/main/java/eu/siacs/conversations/ui/startUI.java index 77ef20c72..e69db94aa 100644 --- a/src/main/java/eu/siacs/conversations/ui/startUI.java +++ b/src/main/java/eu/siacs/conversations/ui/startUI.java @@ -12,7 +12,6 @@ import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.util.Log; -import java.util.Arrays; import java.util.List; import eu.siacs.conversations.Config; @@ -20,9 +19,6 @@ import eu.siacs.conversations.R; import pub.devrel.easypermissions.AfterPermissionGranted; import pub.devrel.easypermissions.EasyPermissions; -/** - * Created by Christian on 10.06.2016. - */ public class startUI extends AppCompatActivity implements EasyPermissions.PermissionCallbacks { @@ -55,6 +51,13 @@ public class startUI extends AppCompatActivity startActivity(intent); finish(); } else { + // set first start to 0 if there are permissions to request + String PREFS_NAME = "FirstStart"; + long FirstStartTime = 0; + SharedPreferences FirstStart = getApplicationContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = FirstStart.edit(); + editor.putLong("FirstStart", FirstStartTime); + editor.commit(); // Do not have permissions, request them now EasyPermissions.requestPermissions(this, getString(R.string.request_permissions_message), NeededPermissions, perms); |