Prevent crash

This commit is contained in:
M66B
2018-08-17 05:34:46 +00:00
parent ff12eaf0fb
commit d012567435
3 changed files with 9 additions and 3 deletions

View File

@@ -59,6 +59,7 @@ import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@@ -347,7 +348,8 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
switch (item.getItemId()) {
case android.R.id.home:
getSupportFragmentManager().popBackStack();
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getSupportFragmentManager().popBackStack();
return true;
default:
return false;