I have a problem .. I want only email activities to resolve intent ACTION.SEND but beside email I get other apps as well (e.g TubeMate) even though I have set the mime type as 'message/rfc822' ... Any idea how can I get Email applications to resolve it ..
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
u can also use:
have fun (combination of both ;))
When I use intent android.content.Intent.ACTION_SENDTO doesn't work for me because it shows many apps, some apps are not email clients. I found this way and it works perfectly for me.
Try this
Credit: https://medium.com/@cketti/android-sending-email-using-intents-3da63662c58f
In Android, there's no such thing as an email activity. There's also no intent filter that can be created to include only email applications. Each application (or activity) can define its own intent filters.
So when using intent ACTION_SEND, you'll have to rely on the users intelligence to pickhis favorite email app from the chooser (and not TubeMate).
Refer https://developer.android.com/guide/components/intents-common.html#Email
The point is to use
ACTION_SENDTO
as action andmailto:
as data. If you want to let the user specify the destination email, use justmailto:
; if you specify email yourself, usemailto:name@domain.com
Suggested method filters all the application, that can send email(such as default email app or gmail)