Prevent crashes when IME's settings activity is missing

bug: 5029444
Change-Id: I5c045123dbca2581f2e7d9f602e7511398b83504
This commit is contained in:
Ken Wakasa
2011-08-10 16:58:53 +09:00
parent 1a787cf362
commit 1c2b175d7a

View File

@@ -21,6 +21,7 @@ import com.android.settings.SettingsPreferenceFragment;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Fragment; import android.app.Fragment;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
@@ -102,7 +103,13 @@ public class InputMethodPreference extends CheckBoxPreference
new OnClickListener() { new OnClickListener() {
@Override @Override
public void onClick(View arg0) { public void onClick(View arg0) {
mFragment.startActivity(mSettingsIntent); try {
mFragment.startActivity(mSettingsIntent);
} catch (ActivityNotFoundException e) {
Log.d(TAG, "IME's Settings Activity Not Found: " + e);
// If the IME's settings activity does not exist, we can just
// do nothing...
}
} }
}); });
} }