Deliver/pop on started instead of resumed

https://developer.android.com/guide/components/activities/activity-lifecycle#onstart
This commit is contained in:
M66B
2019-07-27 08:02:00 +02:00
parent 9d234aa9a4
commit 0191240a27
13 changed files with 56 additions and 56 deletions

View File

@@ -207,7 +207,7 @@ public class ActivityCompose extends ActivityBilling implements FragmentManager.
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
onBackPressed();
return true;
default:
@@ -234,7 +234,7 @@ public class ActivityCompose extends ActivityBilling implements FragmentManager.
private BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
if (ACTION_SHOW_PRO.equals(intent.getAction()))
onShowPro(intent);
}
@@ -242,7 +242,7 @@ public class ActivityCompose extends ActivityBilling implements FragmentManager.
};
private void onShowPro(Intent intent) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getSupportFragmentManager().popBackStack("pro", FragmentManager.POP_BACK_STACK_INCLUSIVE);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();