Reputation: 5758
I have an application that consists of an editText field and a button. The user can enter an address into the field and when they press the button an intent is created that calls the Google Maps application.
This then loads up as expected but for some reason the address supplied is not located...
I have no idea why.
Reference to EditText in my XML layout file.
address = (EditText)findViewById(R.id.addressBox);
Retrieving the input from the EditText field and initiating a new Intent.
String location = address.getText().toString();
location = location.replace(" ", "+");
Intent i = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + address));
startActivity(i);
Any advice is much appreciated.
When I try to find the address google maps starts as expected and a Toast is displayed with this error message:
"No Results found for: android.widget.EditText 40d9fef8"
Upvotes: 1
Views: 1942
Reputation: 2633
It looks like you are passing your edit text in your new Intent()
. Take another look at it I suspect you meant "geo:0,0?q=" + location
.
Upvotes: 2