diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-12-06 04:57:23 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-12-06 04:57:23 -0800 |
commit | f304deff7729e4199760f74687b96494232232de (patch) | |
tree | 1a850c2ece127b65ebd77b2bb5c95f0cd9236949 | |
parent | be01dc243365529c173e4e7ea17833d927974a8c (diff) | |
parent | 1011037364354a9371a39e407b98fae211e104d9 (diff) | |
download | android_packages_apps_Snap-f304deff7729e4199760f74687b96494232232de.tar.gz android_packages_apps_Snap-f304deff7729e4199760f74687b96494232232de.tar.bz2 android_packages_apps_Snap-f304deff7729e4199760f74687b96494232232de.zip |
Merge "SnapdragonCamera: fix app crash when there is no map app"
-rw-r--r-- | res/values-zh-rCN/strings.xml | 3 | ||||
-rw-r--r-- | res/values/qcomstrings.xml | 3 | ||||
-rw-r--r-- | src/com/android/camera/util/CameraUtil.java | 10 |
3 files changed, 14 insertions, 2 deletions
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 42a59a262..fc1e3c320 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -514,6 +514,9 @@ <string name="pref_camera_auto_hdr_entry_enable">开</string> <string name="pref_camera_auto_hdr_entry_disable">关</string> + <!-- The message is shown in toast when click showOnMap Menu and there is no map app --> + <string name="map_activity_not_found_err">没有地图应用显示地理位置信息</string> + <!-- toast about switch storage --> <string name="on_switch_save_path_to_sdcard">内部存储空间不足,已切换存储到SD卡</string> </resources> diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml index c76f5c658..ba99a0c57 100644 --- a/res/values/qcomstrings.xml +++ b/res/values/qcomstrings.xml @@ -850,6 +850,9 @@ <string name="pref_camera_video_rotation_entry_180">180</string> <string name="pref_camera_video_rotation_entry_270">270</string> + <!-- The message is shown in toast when click showOnMap Menu and there is no map app --> + <string name="map_activity_not_found_err">There is no map app for show location.</string> + <!-- Continous shot enable message --> <string name="longshot_enable_message"> Advance features are not supported in continuous shot mode</string> diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index a80db9f09..60d4f065c 100644 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -1035,8 +1035,14 @@ public class CameraUtil { // Use the "geo intent" if no GMM is installed Log.e(TAG, "GMM activity not found!", e); String url = String.format(Locale.ENGLISH, "geo:%f,%f", latLong[0], latLong[1]); - Intent mapsIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); - activity.startActivity(mapsIntent); + try { + Intent mapsIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + activity.startActivity(mapsIntent); + } catch (ActivityNotFoundException ex) { + Log.e(TAG, "Map view activity not found!", ex); + Toast.makeText(activity, activity.getString(R.string.map_activity_not_found_err), + Toast.LENGTH_SHORT).show(); + } } } |