From 10a58d25fd7b6c79a34612a76346b6a8e8073020 Mon Sep 17 00:00:00 2001 From: Bharadwaj Narasimha Date: Fri, 1 Jul 2016 13:40:54 -0700 Subject: 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 --- src/com/cyanogenmod/setupwizard/ui/LoadingFragment.java | 12 ++++++++++-- 1 file 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()); + } } } } -- cgit v1.1