Issue 1817 don't include name/title in map search

git-svn-id: https://zxing.googlecode.com/svn/trunk@2987 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen@gmail.com 2013-12-04 18:42:19 +00:00
parent cf6cbcd84a
commit f4329e7d15
2 changed files with 3 additions and 10 deletions

View file

@ -140,9 +140,7 @@ public final class AddressBookResultHandler extends ResultHandler {
addressResult.getGeo()); addressResult.getGeo());
break; break;
case 1: case 1:
String[] names = addressResult.getNames(); searchMap(address1);
String title = names != null ? names[0] : null;
searchMap(address1, title);
break; break;
case 2: case 2:
dialPhone(addressResult.getPhoneNumbers()[0]); dialPhone(addressResult.getPhoneNumbers()[0]);

View file

@ -358,14 +358,9 @@ public abstract class ResultHandler {
* Do a geo search using the address as the query. * Do a geo search using the address as the query.
* *
* @param address The address to find * @param address The address to find
* @param title An optional title, e.g. the name of the business at this address
*/ */
final void searchMap(String address, String title) { final void searchMap(String address) {
String query = address; launchIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(address))));
if (title != null && !title.isEmpty()) {
query += " (" + title + ')';
}
launchIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(query))));
} }
final void getDirections(double latitude, double longitude) { final void getDirections(double latitude, double longitude) {