2011-04-26

New alarm action to launch an application main activity

I was struggling to add this feature my application because I believe it won't do much help. Still, I tried to implement this as a practice. It's pretty easy to get all installed applications on the phone by these lines.



and you can launch the main activity of an application by
Intent launchIntent = pm.getLaunchIntentForPackage(packageName);
launchIntent.setFlags(Intent.FLAG_ACTIVIY_NEW_TASK|Intent.FLAG_ACTIVITY_NO_USER_ACTION);
context.startActivity(launchIntent);

What I said it doesn't do much help is that you can only bring up an activity unless you know how to talk to it through its public interface.