diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-06-14 21:23:09 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-06-14 21:23:09 +0200 |
commit | dd3b9084af4483d6c1d27313d0d582b4e502fb00 (patch) | |
tree | c85eb2bd279add7ec17045322a26fe998cc78853 | |
parent | 232de4436c05f40f7f3a7c8afceaedb9cf2d7674 (diff) |
make StartUI resistant against rotations and don't restart app when not necessary
-rw-r--r-- | src/main/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 2 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/startUI.java | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 7a95c8b91..61593ed48 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -50,6 +50,7 @@ <activity android:name=".ui.startUI" + android:configChanges="orientation|screenSize" android:theme="@style/Theme.AppCompat.Light.NoActionBar" android:label="@string/app_name" android:launchMode="singleTask" diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 16d49ccf7..b3a8b0141 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -126,7 +126,7 @@ public class ConversationActivity extends XmppActivity private AtomicBoolean mRedirected = new AtomicBoolean(false); private Pair<Integer, Intent> mPostponedActivityResult; - long FirstStartTime = 0; + long FirstStartTime = -1; @SuppressLint("NewApi") private static List<Uri> extractUriFromIntent(final Intent intent) { diff --git a/src/main/java/eu/siacs/conversations/ui/startUI.java b/src/main/java/eu/siacs/conversations/ui/startUI.java index 5b919dbad..c2758054b 100644 --- a/src/main/java/eu/siacs/conversations/ui/startUI.java +++ b/src/main/java/eu/siacs/conversations/ui/startUI.java @@ -5,6 +5,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.net.Uri; import android.os.Bundle; import android.provider.Settings; @@ -101,6 +102,11 @@ public class startUI extends AppCompatActivity } @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + } + + @Override protected void onDestroy() { super.onDestroy(); } |