的圖像存儲在Android的SD卡發送電子郵件與安卓(解決方案)附圖片
我得到了解決,我們需要指定
<uses-permission android:name="android.permission.SEND_SMS"/>
清單中
和工作代碼爲:
String _path = Environment.getExternalStorageDirectory() + "/mapp/test.jpeg";
File file = new File(_path);
Uri outputFileUri = Uri.fromFile(file);
if(file.exists())
{
//final ConnectivityManager connMgr = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
//final int result = connMgr.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,Phone.FEATURE_ENABLE_MMS);
Toast.makeText(context,"exists",Toast.LENGTH_LONG).show();
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("image/jpeg");
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"[email protected]"});
sendIntent.putExtra(Intent.EXTRA_SUBJECT,"World Toyata(via Android App");
sendIntent.putExtra(Intent.EXTRA_STREAM,outputFileUri);
sendIntent.putExtra(Intent.EXTRA_TEXT,"Problem Area Image");
startActivity(Intent.createChooser(sendIntent, ""));
}
else
{
Toast.makeText(context,"SD CARD Required ",Toast.LENGTH_LONG).show();
}
}
喜的朋友我在等待UR答覆plz幫助找到一種方法將圖片附加到Android電子郵件 – 2010-09-13 04:40:01
我得到了我們需要指定 – 2010-09-14 08:55:47
你不應該需要對電子郵件 – 2011-03-03 12:39:24