make sure there is an application with maps before sending the intent

This commit is contained in:
tibbi 2017-01-23 23:05:25 +01:00
parent 5bba8d27dc
commit 2c4bbfb0e2
12 changed files with 17 additions and 1 deletions

View file

@ -175,7 +175,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val encodedQuery = Uri.encode(query) val encodedQuery = Uri.encode(query)
val uriString = "$uriBegin?q=$encodedQuery&z=16" val uriString = "$uriBegin?q=$encodedQuery&z=16"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uriString)) val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uriString))
startActivity(intent) val packageManager = packageManager
if (intent.resolveActivity(packageManager) != null) {
startActivity(intent)
} else {
toast(R.string.no_map_application)
}
} }
} }

View file

@ -21,6 +21,7 @@
<string name="other_folder">andere Ordner</string> <string name="other_folder">andere Ordner</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Größe ändern</string> <string name="resize">Größe ändern</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Other folder</string> <string name="other_folder">Other folder</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Autre dossier</string> <string name="other_folder">Autre dossier</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Redimensionner</string> <string name="resize">Redimensionner</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Other folder</string> <string name="other_folder">Other folder</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Other folder</string> <string name="other_folder">Other folder</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Outra pasta</string> <string name="other_folder">Outra pasta</string>
<string name="show_on_map">Mostrar no mapa</string> <string name="show_on_map">Mostrar no mapa</string>
<string name="unknown_location">Localização desconhecida</string> <string name="unknown_location">Localização desconhecida</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Redimensionar</string> <string name="resize">Redimensionar</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Другая папка</string> <string name="other_folder">Другая папка</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Изменить размер</string> <string name="resize">Изменить размер</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Andra mappar</string> <string name="other_folder">Andra mappar</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Ändra storlek</string> <string name="resize">Ändra storlek</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">其他文件夹</string> <string name="other_folder">其他文件夹</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">缩放</string> <string name="resize">缩放</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">其他資料夾</string> <string name="other_folder">其他資料夾</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">縮放</string> <string name="resize">縮放</string>

View file

@ -21,6 +21,7 @@
<string name="other_folder">Other folder</string> <string name="other_folder">Other folder</string>
<string name="show_on_map">Show on map</string> <string name="show_on_map">Show on map</string>
<string name="unknown_location">Unknown location</string> <string name="unknown_location">Unknown location</string>
<string name="no_map_application">No application with maps has been found</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>