0

如何在没有用户干预的情况下发送带有图像的文本消息

short SMS_PORT = 15005; 
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNo, null, sms, null, null);
smsManager.sendDataMessage("5556",null,SMS_PORT,bFile,null,null);
//bFile is a Image byte Array which is stored in sdcard

短信发送成功,但图片没有发送

4

1 回答 1

-1

使用此代码并让我知道它是否有效:

Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.putExtra("sms_body", "some text"); 
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
sendIntent.setType("image/png"); 
于 2012-12-25T06:37:21.013 回答