when sending mail via a Intent we are getting bluetooth also in th echooser why?
when sending开发者_运维知识库 mails from intent we are calling the intent using such as these codestartActivity(Intent.createChooser(emailIntent, "Send your email in:"))
, but we are getting Bluetooth also in the chooser, how to avoid Bluetooth from the chooser.
You cannot "avoid Bluetooth from the chooser". If it says it supports your Intent
, it will appear in the chooser. This is not significantly different than any other application that supports your Intent
.
Either adjust your Intent
to be more specific (e.g., did you specify a MIME type?) or roll your own "chooser" using PackageManager
and queryIntentActivities()
. How, precisely, you will filter out Bluetooth in a cross-device/cross-version manner, I have no idea.
emailIntent.setType("application/octet-stream");
works for me! :-)
精彩评论