android: Replace deprecated getFragmentManager() in TNC-related Fragments

This commit is contained in:
Tobias Brunner 2020-10-06 14:28:05 +02:00
parent e106fce483
commit a7713372d3
2 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ public class ImcStateFragment extends Fragment implements VpnStateListener
context.bindService(new Intent(context, VpnStateService.class), context.bindService(new Intent(context, VpnStateService.class),
mServiceConnection, Service.BIND_AUTO_CREATE); mServiceConnection, Service.BIND_AUTO_CREATE);
/* hide it initially */ /* hide it initially */
getFragmentManager().beginTransaction().hide(this).commit(); getParentFragmentManager().beginTransaction().hide(this).commit();
} }
@Override @Override
@ -192,7 +192,7 @@ public class ImcStateFragment extends Fragment implements VpnStateListener
public void updateView() public void updateView()
{ {
FragmentManager fm = getFragmentManager(); FragmentManager fm = getParentFragmentManager();
if (fm == null) if (fm == null)
{ {
return; return;

View File

@ -81,7 +81,7 @@ public class RemediationInstructionsFragment extends ListFragment
{ {
super.onStart(); super.onStart();
boolean two_pane = getFragmentManager().findFragmentById(R.id.remediation_instruction_fragment) != null; boolean two_pane = getParentFragmentManager().findFragmentById(R.id.remediation_instruction_fragment) != null;
if (two_pane) if (two_pane)
{ /* two-pane layout, make list items selectable */ { /* two-pane layout, make list items selectable */
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);