I have a BroadcastReceiver which is supposed to start an activity on receive of sms. But though the BroadcastReceiver is calling startActivity() with proper data, activity is not getting launched if I minimize the app and I am in homescreen.
I have used FLAG_ACTIVITY_REORDER_TO_FRONTand FLAG_ACTIVITY_NEW_TASK separately.
Below is my code
public void onReceive(Context context, Intent intent) {
Intent msgIntent = new Intent(context, MyActivity.class);
msgIntent.putExtra("dataString", "my data");
msgIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
context.startActivity(msgIntent);
}
This problem is only occurring in Jelly bean. In higher version the issue is not observed. If I am at homescreen MyActivity.java is not launching.