开发者

when sending mail via a Intent we are getting bluetooth also in th echooser why?

开发者 https://www.devze.com 2023-02-25 08:37 出处:网络
when sending开发者_运维知识库 mails from intent we are callingthe intent using such as these codestartActivity(Intent.createChooser(emailIntent, \"Send your email in:\")), but we are getting Bluetooth

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! :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消