【发布时间】:2016-04-12 09:02:21
【问题描述】:
我正在开发一个应用程序,我必须将我的活动中的位置分享到社交媒体,直到现在我可以将位置分享为链接,但我想分享位置并将其显示为 Whatsapp 显示位置,我用地图图像表示。
谁能指导我如何做到这一点。 我试过下面的方法
String geoUri = "http://maps.google.com/maps?q=loc:" + driveToLocation.getPosition().latitude + "," +
driveToLocation.getPosition().longitude ;
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My Location Name");
shareIntent.putExtra(Intent.EXTRA_TEXT, geoUri);
startActivity(Intent.createChooser(shareIntent, "Share via"));
提前致谢。
【问题讨论】:
-
此问题已在此处提出并回答:stackoverflow.com/questions/12668551/…
标签: android