[英]How to make my app receive location intents like Google Maps
If you opened a link like this on your android phone Google maps will automatically open and show you the location on it's map. 如果你打开像一个链接这个 Android手机谷歌地图会自动打开并显示您在它的地图位置。
I want to make my app receive intents if the user opened a link like this and also i want to get the lat,long from that link. 如果用户打开这样的链接,我也想让我的应用接收意图,并且我也想从该链接中获取经度和纬度。 Is this Possible ?
这可能吗 ?
Assuming the link is stored as String variable link 假设链接存储为String变量链接
Now, 现在,
String[] split_link = link.split(Pattern.quote("@"));
String[] post_link = split_link[1].split(Pattern.quote(","));
double lattitude = Double.parseDouble(post_link[0]);
double longitude = Double.parseDouble(post_link[1]);
Try This!! 尝试这个!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.