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
This commit is contained in:
parent
20037b7ae9
commit
10a58d25fd
@ -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() {
|
||||
try {
|
||||
mLoadingFragment.startActivityForResult(mIntent, mRequestCode, mOptions);
|
||||
mLoadingFragment.mStartActivityForResultRunnable = null;
|
||||
}
|
||||
catch(ActivityNotFoundException e) {
|
||||
Log.e(TAG,"Activity not found to handle intent "+ mIntent.getDataString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user