iap*_*ker 4 android android-manifest android-intent android-permissions
当我的应用程序的用户需要向开发人员发送任何反馈时,我需要使用电子邮件功能.我将使用以下代码.我想知道这是否需要在Manifest文件中设置任何权限.
请建议,如果这需要任何必须在清单文件中设置的权限
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"recipient@example.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(MyActivity.this, "There are no email clients installed.",Toast.LENGTH_SHORT).show();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6764 次 |
| 最近记录: |