summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharadwaj Narasimha <bnarasimha@cyngn.com>2016-07-01 13:40:54 -0700
committerBharadwaj Narasimha <bnarasimha@cyngn.com>2016-07-08 11:03:14 -0700
commit10a58d25fd7b6c79a34612a76346b6a8e8073020 (patch)
tree6ca4fc13f8d7aec171bffa19e34b301652080e7e
parent20037b7ae97495859ab6c64e0587062768a610c2 (diff)
downloadpackages_apps_SetupWizard-10a58d25fd7b6c79a34612a76346b6a8e8073020.zip
packages_apps_SetupWizard-10a58d25fd7b6c79a34612a76346b6a8e8073020.tar.gz
packages_apps_SetupWizard-10a58d25fd7b6c79a34612a76346b6a8e8073020.tar.bz2
SetupWizard: Handle ActivityNotFoundException in LoadingFragment
Handle the possibly thrown ActivityNotFoundException.Changed the generic catch block into a specific catch block to handle ActivityNotFoundException. Change-Id: Ica1106bab3e569aaa7883898ce6adb3a1a2dd99f
-rw-r--r--src/com/cyanogenmod/setupwizard/ui/LoadingFragment.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/setupwizard/ui/LoadingFragment.java b/src/com/cyanogenmod/setupwizard/ui/LoadingFragment.java
index 184a252..d21af84 100644
--- a/src/com/cyanogenmod/setupwizard/ui/LoadingFragment.java
+++ b/src/com/cyanogenmod/setupwizard/ui/LoadingFragment.java
@@ -16,15 +16,19 @@
package com.cyanogenmod.setupwizard.ui;
+import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
+import android.util.Log;
import com.cyanogenmod.setupwizard.R;
public class LoadingFragment extends SetupPageFragment {
private StartActivityForResultRunnable mStartActivityForResultRunnable;
+ private static final String TAG = "LoadingFragment";
+
@Override
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
if (isResumed()) {
@@ -74,8 +78,12 @@ public class LoadingFragment extends SetupPageFragment {
@Override
public void run() {
- mLoadingFragment.startActivityForResult(mIntent, mRequestCode, mOptions);
- mLoadingFragment.mStartActivityForResultRunnable = null;
+ try {
+ mLoadingFragment.startActivityForResult(mIntent, mRequestCode, mOptions);
+ }
+ catch(ActivityNotFoundException e) {
+ Log.e(TAG,"Activity not found to handle intent "+ mIntent.getDataString());
+ }
}
}
}