与共享意图活动共享位置 [英] share location with share intent Activity

查看:39
本文介绍了与共享意图活动共享位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用共享意图活动从我的应用中共享位置,我已经浏览了一些示例并知道如何实现共享意图.但是我被困在 setType 上.我需要我的应用程序来共享位置详细信息以及用户在地图上的位置.

I need to share location from my app using the share intent activity, I have gone through some examples and know how to implement share intent. However I am stuck at setType. I need my application to share location details as well the users location on a map.

顺便说一句,我复制了一个用户代码,其中有一个非常相似的问题无罪"

By the way i copied a users code with a very similar question"no offence"

任何帮助将不胜感激.

Intent intent1 = new Intent(Intent.ACTION_SEND); 
intent1.setType("text/plain"); 
intent1.putExtra(Intent.EXTRA_TEXT, "The status update text"); 
startActivity(Intent.createChooser(intent1, "Select prefered Service")); 

推荐答案

以下是使用位置向地图触发 Intent 的代码:

Here is the code to fire an intent to the map with a location:

String uri = "geo:" + latitude + ","
                    +longitude + "?q=" + latitude
                    + "," + longitude;
startActivity(new Intent(android.content.Intent.ACTION_VIEW,
                    Uri.parse(uri)));

这篇关于与共享意图活动共享位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆