1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2024-12-24 15:30:46 +01:00

fixed NPE

This commit is contained in:
Mariotaku Lee 2015-10-22 11:30:36 +08:00
parent a73cc68259
commit 413d256268

View File

@ -238,11 +238,13 @@ public class HostMappingsListFragment extends BaseListFragment implements MultiC
mEditAddress.addTextChangedListener(this);
mCheckExclude.setOnCheckedChangeListener(this);
final Bundle args = getArguments();
mEditHost.setEnabled(!args.getBoolean(EXTRA_EDIT_MODE, false));
if (savedInstanceState == null) {
mEditHost.setText(args.getCharSequence(EXTRA_HOST));
mEditAddress.setText(args.getCharSequence(EXTRA_ADDRESS));
mCheckExclude.setChecked(args.getBoolean(EXTRA_EXCLUDED));
if (args != null) {
mEditHost.setEnabled(!args.getBoolean(EXTRA_EDIT_MODE, false));
if (savedInstanceState == null) {
mEditHost.setText(args.getCharSequence(EXTRA_HOST));
mEditAddress.setText(args.getCharSequence(EXTRA_ADDRESS));
mCheckExclude.setChecked(args.getBoolean(EXTRA_EXCLUDED));
}
}
builder.setTitle(R.string.add_host_mapping);
builder.setPositiveButton(android.R.string.ok, this);