I've built an sms app wich support all features for sms activities(only sms). But now, my problem is that when my app is already the default one for sms, I can't get the number from contact view when I'd like to send sms to it through my app. Here are images to explain what I'd like to achieve.! When I click to the sms icon,my app is opened by I can't get the number I do not have any code to handle the action SEND/SENDTO in my activity, but I just mentioned the intent-filter:action.SEND, action.SENDTO in the manifest file, as it is obligatory if we want to make the app selectable as the default sms app. I thought that the number from the contact view is accessed from the onActivityResult but it seems to not work, please help!
相关问题
- 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
When getting a
SENDTO
from Contacts, the number - possibly multiple numbers - will be attached as the dataUri
on theIntent
that started yourActivity
. When initializing yourActivity
, check for the appropriate action, and retrieve the number(s) if necessary.For a basic example:
For a more solid implementation, it would be prudent to strip any additional parameters that might be on the
Uri
, and to replace any non-Latin digits.If multiple numbers are received, they should come in a comma- or semicolon-delimited
String
. The above replaces commas with semicolons, so we don't need to worry later about which was used. You can then simplysplit()
thenumbers
to get the individual numbers, should you've received more than one.