I've got a broadcast receiver that gets triggered when a notification my app created is clicked. When that broadcast receiver is started it completes a task then tries to bring of the sms conversations. It works fine on the emulator, however when I try it on a droid incredible it crashes with the following message
07-07 22:57:23.901: WARN/ActivityManager(81): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.mms/.ui.ConversationList } from ProcessRecord{460a37f8 6949:msc.test/10081} (pid=6949, uid=10081) requires null
07-07 22:57:51.661: ERROR/AndroidRuntime(6949): java.lang.RuntimeException: Unable to start receiver msc.test.notifyclear: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.mms/.ui.ConversationList } from ProcessRecord{460a37f8 6949:msc.test/10081} (pid=6949, uid=10081) requires null
07-07 23:18:29.391: ERROR/AndroidRuntime(7729): Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.mms/.ui.ConversationList } from ProcessRecord{46452720 7729:msc.test/10081} (pid=7729, uid=10081) requires null
The code just looks like the following
public void onReceive(Context _context, Intent _intent)
{
// do stuff
try
{
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
intent.setClassName("com.android.mms", "com.android.mms.ui.ConversationList");
_context.startActivity(intent);
}
catch(ActivityNotFoundException e)
{
//handle except
}
}