I'm developing an app where I have to share a location from my activity to social media, until now I can share the location as link, but i want to share the location and display it as Whatsapp shows the location , i mean with the map image.
Can any one guide me to how to do this. I'v tried the bellow
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"));
Thanks in advance .