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:
- 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.
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.putExtra("address", "12125551212");
smsIntent.putExtra("sms_body","Body of Message");
startActivity(smsIntent);
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:
Source:
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.
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.
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.