I have found very strange bug with any of the Android application, when we are installing the application in Android Device with given flow.
Also in STEP: 4 if i choose Done option, then launching my application, then it is working fine.
is it an Android OS related bug? or am I doing something wrong?
Any suggestion in this regard really appreciated.
Thanks HImanshu
This solution worked for me,
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
// Activity was brought to front and not created,
// Thus finishing this will get us to the last viewed activity
finish();
return;
}
I solved this with adding this code in SplashActivity's onCreate:
if (!isTaskRoot()
&& getIntent().hasCategory(Intent.CATEGORY_LAUNCHER)
&& getIntent().getAction() != null
&& getIntent().getAction().equals(Intent.ACTION_MAIN)) {
finish();
return;
}
If anyone can find source of this, please let me know - I can't find the original answer I got this from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With