Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors. Test: We can't test it now. But we will have an integration test later. Bug: 110259478 Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
This commit is contained in:
@@ -16,9 +16,6 @@
|
||||
|
||||
package com.android.settings;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@@ -28,6 +25,10 @@ import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.core.SettingsBaseActivity;
|
||||
import com.android.settings.homepage.HomepageFragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
public class SettingsHomepageActivity extends SettingsBaseActivity {
|
||||
|
||||
@Override
|
||||
@@ -51,10 +52,10 @@ public class SettingsHomepageActivity extends SettingsBaseActivity {
|
||||
/**
|
||||
* Switch to a specific Fragment
|
||||
*/
|
||||
public static void switchToFragment(Activity activity, int id, String fragmentName) {
|
||||
public static void switchToFragment(FragmentActivity activity, int id, String fragmentName) {
|
||||
final Fragment f = Fragment.instantiate(activity, fragmentName, null /* args */);
|
||||
|
||||
FragmentManager manager = activity.getFragmentManager();
|
||||
FragmentManager manager = activity.getSupportFragmentManager();
|
||||
manager.beginTransaction().replace(id, f).commitAllowingStateLoss();
|
||||
manager.executePendingTransactions();
|
||||
}
|
||||
|
Reference in New Issue
Block a user