Android issue: This issue is coming only 1st time after installation and clicking on open button, after launching application with launcher icon then issue will never come.
Steps to reproduce the problem.
What happened.
I have explain you general behavior after installation and start app with open button. In my application it create inconsistent state of 2 times started application.
What you think the correct behavior should be.
I have some logs..
10-04 21:45:28.703: INFO/ActivityManager(243): Starting activity: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.test/.TestnewversionActivity } from pid 15146.
"See no category added in intent above"
10-04 21:46:46.109: INFO/ActivityManager(243): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.test/.TestnewversionActivity } from pid 428
"See category added in intent above".
If some one tell me how to Resolve this or tell how to add category as android.intent.category.LAUNCHER on "Open" button click then problem will resolve.
I have tried to add category in intent on app start, oncreate and many places. intent.addCategory("android.intent.category.LAUNCHER"); Also tried to work with IntentFilter, PackageManager.
This issue is in every Android phone.
I have taken Logs on HTC-SENSE Android version 2.3.3
please add code to onCreate
if (isTaskRoot()) {
final Intent intent = getIntent();
final String intentAction = intent.getAction();
if (!intent.hasCategory(Intent.CATEGORY_LAUNCHER) &&
intentAction != null && intentAction.equals(Intent.ACTION_MAIN)) {
finish();
System.exit(0);
}
}
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