Various small crash fixes and guards
Bug: 25501551 Bug: 25583654 Bug: 25510495 Bug: 23575961 Change-Id: Id0e7f6aacdf763bf95b49d281aa8755afcd2e5ef
This commit is contained in:
@@ -25,11 +25,9 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.nfc.PaymentBackend.PaymentAppInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -48,21 +46,11 @@ public class PaymentSettings extends SettingsPreferenceFragment {
|
||||
|
||||
mPaymentBackend = new PaymentBackend(getActivity());
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
ViewGroup contentRoot = (ViewGroup) getListView().getParent();
|
||||
View emptyView = getActivity().getLayoutInflater().inflate(
|
||||
R.layout.nfc_payment_empty, contentRoot, false);
|
||||
contentRoot.addView(emptyView);
|
||||
setEmptyView(emptyView);
|
||||
|
||||
PreferenceManager manager = getPreferenceManager();
|
||||
PreferenceScreen screen = manager.createPreferenceScreen(getActivity());
|
||||
|
||||
List<PaymentAppInfo> appInfos = mPaymentBackend.getPaymentAppInfos();
|
||||
List<PaymentBackend.PaymentAppInfo> appInfos = mPaymentBackend.getPaymentAppInfos();
|
||||
if (appInfos != null && appInfos.size() > 0) {
|
||||
NfcPaymentPreference preference =
|
||||
new NfcPaymentPreference(getPrefContext(), mPaymentBackend);
|
||||
@@ -75,6 +63,16 @@ public class PaymentSettings extends SettingsPreferenceFragment {
|
||||
setPreferenceScreen(screen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
ViewGroup contentRoot = (ViewGroup) getListView().getParent();
|
||||
View emptyView = getActivity().getLayoutInflater().inflate(
|
||||
R.layout.nfc_payment_empty, contentRoot, false);
|
||||
contentRoot.addView(emptyView);
|
||||
setEmptyView(emptyView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
Reference in New Issue
Block a user