views:

56

answers:

1

Is it possible to open up the default Android Messaging activity from inside an activity you write yourself? Like for example: I press a "Mail" button inside my program, and it opens the Android Messaging app just like as if I was to press the Messaging icon on the main screen.

I did something similar to this with the Contacts activity, but only the contact list comes up, no extra functionality like Adding/Modifying/Deleting, etc.

Any ideas?

edit: I found this way to open the "Compose New Message" Activity, I just need to back it up a step. Does anyone know the correct MIME type instead of this one?

Intent sendIntent = new Intent(Intent.ACTION_VIEW); 
sendIntent.setType("vnd.android-dir/mms-sms"); 
m_activity.startActivity(sendIntent); 
+1  A: 

This starts the messaging app from another app:

Intent intent = new Intent("android.intent.action.MAIN");
intent.setComponent(new ComponentName("com.android.mms","com.android.mms.ui.ConversationList"));
startActivity(intent);

Just put it inside a button listener or whatever user input you want to open it from.

Enjoy :-)

Rasmus
Sweet thanks, is there a list of these so I could check for other apps to run? Like the Contacts activity, etc. Thanks again!
gooner15
If you run logcat and start the program you want to start from your own app, you can see what intent the launcher runs to start the app.
Rasmus
the package specified on the first parameter of ComponentName constructor shouldn't be "com.android.mms.ui"?
Tom Brito
According to logcat on the emulator it doesnt want the ui"Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.mms/.ui.ConversationList }"this code is also what works for me :-)
Rasmus