diff options
author | Chris "Koying" Browet <cbro@semperpax.com> | 2014-11-14 14:30:44 +0100 |
---|---|---|
committer | Chris "Koying" Browet <cbro@semperpax.com> | 2014-12-13 10:02:48 +0100 |
commit | 5927da2f905d703e01761b73233dfe9d3d4c07c3 (patch) | |
tree | 5ad5dbb2fd98e60ce72b43b7580664112920ffc6 /tools/android | |
parent | 0c7b6771e75dcab764657d56023ceda25509468e (diff) |
FIX: [droid] consistent splash error handling
Diffstat (limited to 'tools/android')
-rw-r--r-- | tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in index d3a3efb8ef..bcfc939fca 100644 --- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in +++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in @@ -96,7 +96,7 @@ public class Splash extends Activity { mSplash.mState = msg.what; switch(mSplash.mState) { case InError: - mSplash.finish(); + showErrorDialog(mSplash, "Error", mErrorMsg); break; case Checking: break; @@ -122,6 +122,9 @@ public class Splash extends Activity { sendEmptyMessage(StartingXBMC); else { SetupEnvironment(); + if (mState == InError) { + sendEmptyMessage(InError); + } if (fXbmcHome.exists() && fXbmcHome.lastModified() >= fPackagePath.lastModified() && !mInstallLibs) { mState = CachingDone; mCachingDone = true; @@ -268,7 +271,6 @@ public class Splash extends Activity { protected void onPostExecute(Integer result) { super.onPostExecute(result); if (result < 0) { - showErrorDialog(mSplash, "Error", mErrorMsg); mState = InError; } @@ -276,11 +278,11 @@ public class Splash extends Activity { } } - public void showErrorDialog(Context context, String title, String message) { + public void showErrorDialog(final Activity act, final String title, final String message) { if (myAlertDialog != null && myAlertDialog.isShowing()) return; - AlertDialog.Builder builder = new AlertDialog.Builder(context); + AlertDialog.Builder builder = new AlertDialog.Builder(act); builder.setTitle(title); builder.setIcon(android.R.drawable.ic_dialog_alert); builder.setMessage(Html.fromHtml(message)); @@ -288,6 +290,7 @@ public class Splash extends Activity { new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int arg1) { dialog.dismiss(); + act.finish(); } }); builder.setCancelable(false); @@ -637,13 +640,13 @@ public class Splash extends Activity { SetupEnvironment(); MigrateUserData(); - if (fXbmcHome.exists() && fXbmcHome.lastModified() >= fPackagePath.lastModified() && !mInstallLibs) { + if (mState != InError && fXbmcHome.exists() && fXbmcHome.lastModified() >= fPackagePath.lastModified() && !mInstallLibs) { mState = CachingDone; mCachingDone = true; } } - if (mCachingDone && mExternalStorageChecked) { + if (mState != InError && mCachingDone && mExternalStorageChecked) { startXBMC(); return; } @@ -653,7 +656,7 @@ public class Splash extends Activity { mTextView = (TextView) findViewById(R.id.textView1); if (mState == InError) { - showErrorDialog(this, "Error", mErrorMsg); + mStateMachine.sendEmptyMessage(InError); return; } |