diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-05-30 18:28:35 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-05-30 18:28:35 -0700 |
commit | 80e12bf86e2367f2c8a5ac766694dbcbc2531f42 (patch) | |
tree | 488a43edb398571556f07ccb57dd40cbeadeae71 /subsonic-android/src | |
parent | 4bbe30d40b3020db61aa5d26e1805edffd59a558 (diff) | |
parent | 78998ef733936bc3382b9637b0d03691383f9829 (diff) | |
download | dsub-80e12bf86e2367f2c8a5ac766694dbcbc2531f42.tar.gz dsub-80e12bf86e2367f2c8a5ac766694dbcbc2531f42.tar.bz2 dsub-80e12bf86e2367f2c8a5ac766694dbcbc2531f42.zip |
Merge branch 'master' of https://github.com/daneren2005/Subsonic.git
Diffstat (limited to 'subsonic-android/src')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/ErrorDialog.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ErrorDialog.java b/subsonic-android/src/github/daneren2005/dsub/util/ErrorDialog.java index 2928e93f..ab9b4fa3 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/ErrorDialog.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/ErrorDialog.java @@ -21,6 +21,8 @@ package github.daneren2005.dsub.util; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; +import android.content.Intent; +import github.daneren2005.dsub.activity.MainActivity; import github.daneren2005.dsub.R; /** @@ -43,7 +45,7 @@ public class ErrorDialog { @Override public void onCancel(DialogInterface dialogInterface) { if (finishActivityOnClose) { - activity.finish(); + restart(activity); } } }); @@ -51,11 +53,17 @@ public class ErrorDialog { @Override public void onClick(DialogInterface dialogInterface, int i) { if (finishActivityOnClose) { - activity.finish(); + restart(activity); } } }); builder.create().show(); } + + private void restart(Activity context) { + Intent intent = new Intent(context, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + Util.startActivityWithoutTransition(context, intent); + } } |