I am trying to run the main action inside BroadcastReceiver. I do not want to specify the name of the activity class, but use the action and category for android to determine the main activity.
It does not seem to work.
Sending code:
Intent startIntent = new Intent(); startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startIntent.setAction(Intent.ACTION_MAIN); startIntent.setPackage(context.getPackageName()); startIntent.addCategory(Intent.CATEGORY_LAUNCHER); context.startActivity(startIntent);
I get this error:
Caused by bt: android.content.ActivityNotFoundException: No activity detected for processing Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] flg = 0x10000000 pkg = com.xyz.abc (has additional functions )}
Any ideas?
android android-intent alarmmanager
Abhishek
source share