don't show notification in MainActivity when state is restored
This commit is contained in:
@@ -128,6 +128,11 @@ public class MainActivity extends BaseNfcActivity implements FabContainer, OnBac
|
|||||||
|
|
||||||
getSupportFragmentManager().addOnBackStackChangedListener(this);
|
getSupportFragmentManager().addOnBackStackChangedListener(this);
|
||||||
|
|
||||||
|
// all further initialization steps are saved as instance state
|
||||||
|
if (savedInstanceState != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Intent data = getIntent();
|
Intent data = getIntent();
|
||||||
// If we got an EXTRA_RESULT in the intent, show the notification
|
// If we got an EXTRA_RESULT in the intent, show the notification
|
||||||
if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) {
|
if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) {
|
||||||
@@ -135,7 +140,6 @@ public class MainActivity extends BaseNfcActivity implements FabContainer, OnBac
|
|||||||
result.createNotify(this).show();
|
result.createNotify(this).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
|
||||||
// always initialize keys fragment to the bottom of the backstack
|
// always initialize keys fragment to the bottom of the backstack
|
||||||
onKeysSelected();
|
onKeysSelected();
|
||||||
|
|
||||||
@@ -150,7 +154,6 @@ public class MainActivity extends BaseNfcActivity implements FabContainer, OnBac
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user