ImageView display static google URL Map. How to launch maps, when Image Clicked
At this moment, I have an Image View that loads a URL obtained from static google maps. What I'm trying and don't find how to do, is when user clicks on image, launch google maps with the direction. Tried it to open in a web-view, but what opens is the image and not the "map"
MessagingFragment.setMapOnImageClickListener(new UserClicksMapOpenURL() {
@Override
public void onUserClicksImageOpenMap(String url) {
Logger.d("url");
Intent intent=new Intent(ChatActivity.this,WebViewActivity.class);
intent.setData(Uri.parse(url));
startActivity(intent);
}
});
The link looks like:
http://maps.google.com/maps/api/staticmap?center=40.934162499999985,2.552246093750014&zoom=18&size=640x640&scale=2&sensor=false&markers=color:red%7C40.934162499999985,2.552246093750014
Is there any type of intent that launch the google maps?
Shudy you can try to this it can help you.And if you want to more about google map intent then please follow this link
https://developers.google.com/maps/documentation/android-api/intents
Uri gmmIntentUri = Uri.parse("geo:41.543023,2.114436");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
if (mapIntent.resolveActivity(getPackageManager()) != null) {
startActivity(mapIntent);
}
链接地址: http://www.djcxy.com/p/67544.html
上一篇: 保存静态浏览器图像到本地文件夹