views:

255

answers:

2

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 cant 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));

Wich 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 cant seem to get it to work.

Thanks in advanced.

+1  A: 
  1. First, look over the different intent and lanch options. You can see my answer to a similar question. Your code will call something with an StartActivityForResult(). What that is a harder question.

  2. If you are lucky, you can find an INTENT from the messaging application for status. You probably won't, as there isn't a guarantee the phone will be using the system default. After all, when an SMS is received it is put in some messaging database and is 'new' only according to the messaging applications logic. That database isn't shared, for security reasons. You might want to comment on this feature request.

  3. You can write your own application that grabs the 'new SMS' intent and then sends it forward, maybe. See this somewhat old tutorial.

Good luck! Let us know if you make progress.

Charles Merriam
I believe we're talking about two different things here.I just want to replicate this: startActivity(new Intent(this, ConversationList.class));Wich I took from: http://www.google.com/codesearch/p?hl=en#dpDz7Q08o9c/src/com/android/mms/ui/ComposeMessageActivity.java @LINE: 2028On my own app. But I cant seem to get it to work.Thanks in advanced.
Lord Otori
Sorry, I cannot understand your question.
Charles Merriam
I have made an app that shows the user the amount of unread sms. My idea is to "link" that counter to the default sms application.The problem is: I cannot get the default sms application to start at the ConversationList activity.PS: The ConversationList activity is the main screen of the default sms application.
Lord Otori
A: 

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:

Lord Otori