blob: 4cbfa00a0ad18c5d73c3eb295d70c3e8fb2c3745 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
package cgeo.geocaching.apps.cache.navi;
import cgeo.geocaching.R;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.utils.Log;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
class GoogleMapsApp extends AbstractPointNavigationApp {
GoogleMapsApp() {
super(getString(R.string.cache_menu_map_ext), null);
}
@Override
public boolean isInstalled() {
return true;
}
@Override
public void navigate(Activity activity, Geopoint point) {
// INFO: q parameter works with Google Maps, but breaks cooperation with all other apps
try {
activity.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("geo:" + point.getLatitude() + "," + point.getLongitude())));
return;
} catch (RuntimeException e) {
// nothing
}
Log.i("GoogleMapsApp.navigate: No maps application available.");
ActivityMixin.showToast(activity, getString(R.string.err_application_no));
}
}
|