Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorАлександр Зацепин <az@mapswithme.com>2017-12-18 17:35:39 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2017-12-18 17:59:41 +0300
commit6c48479a8f32421126c05ded17a83768e5f38e2c (patch)
tree313dfe8baf0156571685872f5d57a32e8d4ca0cb
parent7d00bc67940866f11417d42bc1f7d2d3660ebee5 (diff)
[android] Added exception handling during url openios-store-801
-rw-r--r--android/src/com/mapswithme/util/Utils.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/android/src/com/mapswithme/util/Utils.java b/android/src/com/mapswithme/util/Utils.java
index e9b5c4f2db..721bb9bac2 100644
--- a/android/src/com/mapswithme/util/Utils.java
+++ b/android/src/com/mapswithme/util/Utils.java
@@ -216,11 +216,18 @@ public class Utils
if (TextUtils.isEmpty(url))
return;
- final Intent intent = new Intent(Intent.ACTION_VIEW);
- if (!url.startsWith("http://") && !url.startsWith("https://"))
- url = "http://" + url;
- intent.setData(Uri.parse(url));
- activity.startActivity(intent);
+ try
+ {
+ final Intent intent = new Intent(Intent.ACTION_VIEW);
+ if (!url.startsWith("http://") && !url.startsWith("https://"))
+ url = "http://" + url;
+ intent.setData(Uri.parse(url));
+ activity.startActivity(intent);
+ }
+ catch (ActivityNotFoundException e)
+ {
+ CrashlyticsUtils.logException(e);
+ }
}
public static void sendSupportMail(@NonNull Activity activity, @NonNull String subject)