Fix bug #15001610 Java crash in settings is observed while adding Google account on wiped device

- make WifiPickerActivity a SettingsActivity (as it was long overdue)
- move code from the overide of PreferenceActivity.startWithFragment() to
SettingsActivity.startPreferencePanel(...)

Change-Id: Ibc42056fdc84e01004e15c3779073e5451fd02a1
This commit is contained in:
Fabrice Di Meglio
2014-05-16 11:00:13 -07:00
parent 08190bbb75
commit 18d271c73b
2 changed files with 14 additions and 21 deletions

View File

@@ -518,7 +518,7 @@ public class Utils {
* entire activity.
*
* @param context The context.
* @param fragmentName The name of the fragment to display.
* @param fragmentClass The class name of the fragment to display.
* @param args Optional arguments to supply to the fragment.
* @param resultTo Option fragment that should receive the result of
* the activity launch.
@@ -526,9 +526,9 @@ public class Utils {
* code in which to report the result.
* @param title String to display for the title of this set of preferences.
*/
public static void startWithFragment(Context context, String fragmentName, Bundle args,
public static void startWithFragment(Context context, String fragmentClass, Bundle args,
Fragment resultTo, int resultRequestCode, CharSequence title) {
Intent intent = onBuildStartFragmentIntent(context, fragmentName, args, title);
Intent intent = onBuildStartFragmentIntent(context, fragmentClass, args, title);
if (resultTo == null) {
context.startActivity(intent);
} else {
@@ -542,17 +542,17 @@ public class Utils {
* appropriate arguments to display the fragment.
*
* @param context The Context.
* @param fragmentName The name of the fragment to display.
* @param fragmentClass The class name of the fragment to display.
* @param args Optional arguments to supply to the fragment.
* @param title Optional title to show for this item.
* @return Returns an Intent that can be launched to display the given
* fragment.
*/
public static Intent onBuildStartFragmentIntent(Context context, String fragmentName,
public static Intent onBuildStartFragmentIntent(Context context, String fragmentClass,
Bundle args, CharSequence title) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClass(context, SubSettings.class);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT, fragmentName);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT, fragmentClass);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS, args);
intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
return intent;