Merge "Fix MobileNetworkSettings crash for multi-SIM device" am: 33cf927f86 am: 0f33d879c3
am: cc12135b5c
Change-Id: I257a317c862f6f16341e91c00990e92ae07fe78c
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 65287a2..98eec67 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -51,8 +51,10 @@
import android.telephony.euicc.EuiccManager;
import android.text.TextUtils;
import android.util.Log;
+import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.TabHost;
import com.android.ims.ImsManager;
@@ -349,8 +351,6 @@
if (DBG) log("initializeSubscriptions: UPDATE");
currentTab = mTabHost != null ? mTabHost.getCurrentTab() : 0;
- getActivity().setContentView(com.android.internal.R.layout.common_tab_settings);
-
mTabHost = (TabHost) getActivity().findViewById(android.R.id.tabhost);
mTabHost.setup();
@@ -389,7 +389,6 @@
mTabHost.clearAllTabs();
mTabHost = null;
}
- getActivity().setContentView(com.android.internal.R.layout.common_tab_settings);
break;
}
case DO_NOTHING: {
@@ -536,10 +535,22 @@
TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);
activity.registerReceiver(mPhoneChangeReceiver, intentFilter);
- initializeSubscriptions();
Log.i(LOG_TAG, "onCreate:-");
}
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(com.android.internal.R.layout.common_tab_settings,
+ container, false);
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ initializeSubscriptions();
+ }
+
private class PhoneChangeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {