I am trying to send MMS using intent.
Here is my code:
private void sendMmsUsingIntent() throws Exception
{
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("address", "1213123123");
sendIntent.putExtra("sms_body", "some text");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/DCIM/Camera/logo.png"));
sendIntent.setType("image/png");
//startActivity(sendIntent);
startActivity(Intent.createChooser(sendIntent,"MMS"));
}
I the above code i have hard coded a file name(logo.png) , I want to remove this dependency can any one pleases help me how to do this?
I want to change it like at certain location in the sdcard card whatever media file are available those i can pick randomly one at a time.`
I followed below one but could not get success
'How to display files on the SD card in a ListView?'
Thanks