我创建了这个片段以通过单击我的 android 应用程序的首选项来发送电子邮件。但我想在电子邮件中使用 Build 类将发送电子邮件的电话功能(如手机名称、Android 版本等)放入电子邮件中。我能怎么做?这是我到目前为止所做的。
Preference Email;
Email = (Preference) this.findPreference("email");
Email.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
// Informazioni sul telefono
String manufacturer = Build.MANUFACTURER;
String model = Build.MODEL;
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String[] recipients = new String[]{"" , "EMAIL@gmail.com"};
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "" );
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
emailIntent.setType("message/rfc822");
startActivity(Intent.createChooser(emailIntent, "Send Email"));
return false;
}
});