Reputation: 1122
I Want to design an App. Which will start on mobile restart. I am able to start my activity by using "android.intent.action.BOOT_COMPLETED" intent but "SAMSUNG NOTE" has facility to restart mobile not needed to switch off and then on here i am facing problem my app is not starting on "restart"
Upvotes: 4
Views: 320
Reputation: 1122
Problem Solved for now by removing code which is commented.
Intent startMainActivity = new Intent(context,MyActivity.class);
startMainActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(startMainActivity);
/* Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(startMain);*/
I was using commented code to launch home screen after my app is launched
Upvotes: 1