Fix the crash during opning the illegal settings of the spell checker

Bug: 5591245
Change-Id: I4ff61a59b0622c74b34bc50a00fc9773c04a6395
This commit is contained in:
satok
2012-05-11 18:37:39 +09:00
parent ee10ceccde
commit e508dc25f2
3 changed files with 18 additions and 3 deletions

View File

@@ -39,6 +39,7 @@ import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Comparator;
import java.util.List;
@@ -126,8 +127,12 @@ public class InputMethodPreference extends CheckBoxPreference
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...
final String msg = mFragment.getString(
R.string.failed_to_open_app_settings_toast,
mImi.loadLabel(
mFragment.getActivity().getPackageManager()));
Toast.makeText(
mFragment.getActivity(), msg, Toast.LENGTH_LONG).show();
}
}
});