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

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

问题描述

我需要使用份额的意图活动从我的应用程序共享的位置,我也通过一些例子不见了,知道如何实现份额的意图。不过,我停留在的setType。我需要我的应用程序在地图上分享位置的详细信息,以及用户的位置。

通过我复制一个用户code具有非常类似的问题没有犯罪

任何帮助,将是真正的AP preciated。

 意图int​​ent1 =新意图(Intent.ACTION_SEND);
intent1.setType(text / plain的);
intent1.putExtra(Intent.EXTRA_TEXT的状态更新文本);
startActivity(Intent.createChooser(intent1,选择prefered服务));


解决方案

下面是code火的意图与位置在地图:

 字符串的uri =缘:+纬度+,
                    +经度+?Q =+纬度
                    +,+经度;
startActivity(新意图(android.content.Intent.ACTION_VIEW,
                    Uri.parse(URI)));

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"

Any assistance would be really appreciated.

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")); 

解决方案

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天全站免登陆