我开发了一个发送电子邮件的应用程序。单击电子邮件按钮时,它应该要求用户选择安装在手机中的电子邮件客户端之一。但是,在我的情况下,它还显示了不需要的蓝牙选项。我搜索了很多,但找不到任何解决方案。下面我发布我的代码。
public class EtestActivity extends Activity {
/** Called when the activity is first created. */
Button email;
Intent in;
private static final String TAG = "EmailLauncherActivity";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
email = (Button)findViewById(R.id.email);
email.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
try {
in = new Intent(Intent.ACTION_SEND);
in.setType("image/jpg");
in.setType("plain/text");
in.setType("application/octet-stream");
in.putExtra(Intent.EXTRA_EMAIL, new String[]{"pranav_kotauniv@yahoo.co.in","friendlynitish@gmail.com"});
in.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/android.jpg"));
startActivity(Intent.createChooser(in, "mailto:"));
} catch (Exception e) {
Log.e(TAG, "email sending failed", e);
}//catch
}//onClick
});
}//onCreate
}//班级