Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

start sms Activity @ ConversarionList.class from my own app

I've done my research and found plenty of people launching the sms application from an intent, The thing is that people usually tend to do this only for outgoing messages.

I'm currently displaying a Unread Sms Count on my app, but it seams I can't get the proper intent to work.

On every try I get the same result, It launches the app but for a new sms...

My current intent looks like this

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("sms:"));
startActivity(intent);

and it's result is:

Android sms Aplication form

  • EDIT: Para -> To
  • Escribir mensaje -> Write Message
  • Enviar -> Send

I hope I'm clear enough about this.

The question is:

How can I go to the inbox of the sms application on Android via an Intent?


EDIT: I just want to replicate this:

startActivity(new Intent(this, ConversationList.class));

Which I took from: http://www.google.com/codesearch/p?hl=en#dpDz7Q08o9c/src/com/android/mms/ui/ComposeMessageActivity.java @LINE: 2028

On my own app. But I can't seem to get it to work.

like image 407
Lord Otori Avatar asked Nov 15 '22 10:11

Lord Otori


1 Answers

What is SetClassName?

In order to start a class located outside the current application we need to declare something like a "Full Path" to it...

In order to open the default sms Application @ConversationList we need to do this:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setClassName("com.android.mms", "com.android.mms.ui.ConversationList");

Source:

  • http://mylifewithandroid.blogspot.com/2007/12/playing-with-intents.html
  • http://javasdn.cn/viewthread.php?action=printable&tid=204
like image 67
Lord Otori Avatar answered Jan 08 '23 17:01

Lord Otori