Fix InstantiationException on fragment

Since we overrided the empty constructor,
it can't find a empty constructor when
Fragment tries to instantiate a fragment
in framework.

So, we can't override this constructor,
and then just use newInstance() to initialize
and setup a new Fragment.

Test: robotest
Change-Id: Ifcd1c1771bc69d947caeee5c5bc055c4f94365c2
Fixes: 115676209
This commit is contained in:
tmfang
2018-10-05 18:45:07 +08:00
parent b402a56fec
commit d5405cf49d
3 changed files with 24 additions and 12 deletions

View File

@@ -113,7 +113,7 @@ public class ProxySelector extends InstrumentedFragment implements DialogCreatab
if (mDialogFragment != null) {
Log.e(TAG, "Old dialog fragment not null!");
}
mDialogFragment = new SettingsDialogFragment(this, dialogId);
mDialogFragment = SettingsDialogFragment.newInstance(this, dialogId);
mDialogFragment.show(getActivity().getSupportFragmentManager(), Integer.toString(dialogId));
}