[英]send mms without user interaction in android
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.putExtra("address", "12134567899");
intent.putExtra("sms_body", "See attached picture");
intent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file:///sdcard/DCIM/Camera/2011-09-09 12.47.29.jpg"));
intent.setType("image/png");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
我嘗試這樣的代碼。 如果意圖開始彩信撰寫ui來了,我該如何克服並自動發送
首先。 祝好運。 由於android sdk不支持MMS,因此您有2個選項:
下載android mms應用程序,然后嘗試了解發生了什么。
請點擊此鏈接: http : //androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html
我目前唯一能找到工作的地方...
此功能在Android中被設計為安全功能,請勿嘗試繞過它。 在那里是有原因的。
如果絕對必須,您是否嘗試過在有根設備上運行它? 它允許更大的訪問。
試試看,這對我有用。 使用Uri.fromFile而不是Uri.parse
File f=new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/DCIM/Camera/"+img_name);
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("", "");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
sendIntent.setType("image/png");
startActivity(sendIntent);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.