How to create the sms dialog?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How to create the sms dialog?

Postby The_One_Neo » Mon Dec 15, 2008 7:44 am

i want create a sms dialog and attach a file

Uri u = Uri.parse("/sdcard/image/123.jpeg");
if (u == null)
return true;

Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
//intent.setType(image.getMimeType());
intent.putExtra(Intent.EXTRA_STREAM, u);

startActivity(Intent.createChooser(intent,getText(R.string.image)));


AndroidMainfest.xml

<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />

but i can't create the sms dialog, warnning is "no applications can perform this action"

where is problem?
The_One_Neo
Developer
Developer
 
Posts: 28
Joined: Wed May 07, 2008 9:34 am

Top

Re: How to create the sms dialog?

Postby Rahul » Mon Dec 15, 2008 11:15 am

Did you test that code in a real android device?

I really doubt if it can work on an emulator

The_One_Neo wrote:i want create a sms dialog and attach a file

Uri u = Uri.parse("/sdcard/image/123.jpeg");
if (u == null)
return true;

Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
//intent.setType(image.getMimeType());
intent.putExtra(Intent.EXTRA_STREAM, u);

startActivity(Intent.createChooser(intent,getText(R.string.image)));


AndroidMainfest.xml

<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />

but i can't create the sms dialog, warnning is "no applications can perform this action"

where is problem?
Rahul
Experienced Developer
Experienced Developer
 
Posts: 89
Joined: Wed Oct 01, 2008 11:16 am

Postby jnasti1 » Thu Jan 22, 2009 7:52 pm

doesn't something like this require the persmission SEND_SMS to go along with WRITE_SMS/READ_SMS?
jnasti1
Freshman
Freshman
 
Posts: 3
Joined: Tue Nov 11, 2008 7:47 pm

Postby MrSnowflake » Thu Jan 22, 2009 8:37 pm

You can't send a jpeg over sms, it should be mss. And maybe you need to set intent category to DEFAULT.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests