Fixed navigation

This commit is contained in:
M66B 2019-05-30 09:19:54 +02:00
parent 9b4649d3d8
commit 16bea88b20
2 changed files with 15 additions and 4 deletions

View File

@ -268,9 +268,20 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
getSupportFragmentManager().addOnBackStackChangedListener(this);
if (getSupportFragmentManager().getFragments().size() == 0) {
Intent intent = getIntent();
String target = intent.getStringExtra("target");
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentSetup()).addToBackStack("setup");
if ("accounts".equals(target))
fragmentTransaction.replace(R.id.content_frame, new FragmentAccounts()).addToBackStack("accounts");
else
fragmentTransaction.replace(R.id.content_frame, new FragmentSetup()).addToBackStack("setup");
fragmentTransaction.commit();
if (intent.hasExtra("target")) {
intent.removeExtra("target");
setIntent(intent);
}
}
if (savedInstanceState != null)

View File

@ -170,9 +170,9 @@ public class FragmentFolders extends FragmentBase {
fabError.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentAccounts()).addToBackStack("accounts");
fragmentTransaction.commit();
Intent intent = new Intent(getContext(), ActivitySetup.class)
.putExtra("target", "accounts");
startActivity(intent);
}
});