0

I want a simple thing. When the user puts his address in the box I want that in the 2nd activity, after I press "show address" it will open google map with the user input address and not "geo" address

public void onClick(View v) {
    if (btSand == v) {
            AdressLoc = etAdress.getText().toString();

            SendMail = etMail.getText().toString();

            Intent intent = new Intent(MainActivity.this, Main2Activity2.class);
            intent.putExtra("name",etName.getText().toString());
            intent.putExtra("Mail",etMail.getText().toString());
            startActivity(intent);
    }
}

first activity image

else if (btnAdress == v) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("geo:31.59,34.55"));
    Intent chooser = Intent.createChooser(intent,"Launch Map");
    startActivity(chooser);
}

second image

james_bond
  • 6,778
  • 3
  • 28
  • 34
Hanan Sabag
  • 29
  • 2
  • 8
  • You might want to check the [Geocoding](https://developers.google.com/maps/documentation/geocoding/intro) to get the address using the lat/long. Here is a related SO [post](http://stackoverflow.com/a/32116202/5995040) that uses the geocoder to translate a lat/long value to an address. You can use the input of the user in the [infowindow](https://developers.google.com/maps/documentation/android-api/infowindows) if you don't want to use the return value of the geo address. Hope this helps. – Mr.Rebot Dec 14 '16 at 16:42
  • no its not help becuz im using somthing more simple i just want the user input like intent.setData(Uri.parse("geo:" + userInput)); – Hanan Sabag Dec 15 '16 at 09:16

0 Answers0