android.intent.action.SENDTO : Displays activity com.android.mms/.ui.ConversationList in Galaxy tab
I have used the intent android.intent.action.SENDTO to start the activity for text messaging.
In the emulator and some android phones like htc, the activity that gets displayed is activity com.android.mms/.ui.ComposeMessageActivity. The text message body could also be set .
While in Galaxy tab com.android.mms/.ui.ConversationList is the activity that gets displayed and the message body could not 开发者_运维百科be set.
The following is my code:
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:"));
intent.putExtra("sms_body", messageBody);
intent.putExtra("compose_mode", true);
startActivity(intent);
How could I start activity ComposeMessageActivity in Galaxy tab or set the message body if the displayed activity is ConversationList?
I got a solution. I replaced the intent Intent.ACTION_SENDTO with Intent.ACTION_VIEW.
This is the new code :
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.putExtra("sms_body", messageBody);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent );.
This is where I got the solution : Link
精彩评论