1

画像は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[] {"abc@cde.com"});
    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();
}

            }                   
4

1 に答える 1

0

Ramesh - あなたの例には価値があると思いましたが、android.permission.SEND_SMS の許可を得る必要がないこともわかりました。

startActivity(Intent.createChooser(sendIntent, "Email:")); が必要かどうか疑問に思っています。

ここで「Email:」を指定します。

于 2011-03-08T13:56:28.210 に答える