Commit 611fe792 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Set LoginActivity and AddServerActivity flag to Intent.FLAG_ACTIVITY_SINGLE_TOP

parent f049544e
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
<activity <activity
android:name=".activity.AddServerActivity" android:name=".activity.AddServerActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:windowSoftInputMode="adjustResize"/> android:windowSoftInputMode="adjustResize"
android:launchMode="singleTop"/>
<activity <activity
android:name=".activity.LoginActivity" android:name=".activity.LoginActivity"
......
...@@ -26,7 +26,7 @@ public class LaunchUtil { ...@@ -26,7 +26,7 @@ public class LaunchUtil {
*/ */
public static void showAddServerActivity(Context context) { public static void showAddServerActivity(Context context) {
Intent intent = new Intent(context, AddServerActivity.class); Intent intent = new Intent(context, AddServerActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
context.startActivity(intent); context.startActivity(intent);
} }
...@@ -35,7 +35,7 @@ public class LaunchUtil { ...@@ -35,7 +35,7 @@ public class LaunchUtil {
*/ */
public static void showLoginActivity(Context context, String hostname) { public static void showLoginActivity(Context context, String hostname) {
Intent intent = new Intent(context, LoginActivity.class); Intent intent = new Intent(context, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra(LoginActivity.KEY_HOSTNAME, hostname); intent.putExtra(LoginActivity.KEY_HOSTNAME, hostname);
context.startActivity(intent); context.startActivity(intent);
} }
......
...@@ -90,6 +90,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -90,6 +90,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
private void showAddServerActivity() { private void showAddServerActivity() {
Intent intent = new Intent(this, AddServerActivity.class); Intent intent = new Intent(this, AddServerActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra(AddServerActivity.EXTRA_FINISH_ON_BACK_PRESS, true); intent.putExtra(AddServerActivity.EXTRA_FINISH_ON_BACK_PRESS, true);
startActivity(intent); startActivity(intent);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment