aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-30 18:28:35 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-30 18:28:35 -0700
commit80e12bf86e2367f2c8a5ac766694dbcbc2531f42 (patch)
tree488a43edb398571556f07ccb57dd40cbeadeae71 /subsonic-android/src
parent4bbe30d40b3020db61aa5d26e1805edffd59a558 (diff)
parent78998ef733936bc3382b9637b0d03691383f9829 (diff)
downloaddsub-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.java12
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);
+ }
}