I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit b853c3af authored by str4d's avatar str4d
Browse files

Only call onBackPressed for I2PFragmentBase subclasses

parent 17be8fb3
No related branches found
No related tags found
No related merge requests found
......@@ -147,10 +147,13 @@ public class MainActivity extends ActionBarActivity {
@Override
public void onBackPressed() {
I2PFragmentBase fragment = (I2PFragmentBase) getSupportFragmentManager().findFragmentById(R.id.main_content);
// If we shouldn't stay on this fragment, go back.
if (!fragment.onBackPressed()) {
super.onBackPressed();
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.main_content);
if (fragment instanceof I2PFragmentBase) {
I2PFragmentBase ifb = (I2PFragmentBase) fragment;
// If we shouldn't stay on this fragment, go back.
if (ifb.onBackPressed())
return;
}
super.onBackPressed();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment