diff --git a/app/src/main/java/net/gsantner/opoc/ui/LanguagePreference.java b/app/src/main/java/net/gsantner/opoc/ui/LanguagePreference.java index 03e64c2f..5a41be6d 100644 --- a/app/src/main/java/net/gsantner/opoc/ui/LanguagePreference.java +++ b/app/src/main/java/net/gsantner/opoc/ui/LanguagePreference.java @@ -19,7 +19,7 @@ buildConfigField("String[]", "APPLICATION_LANGUAGES", '{' + getUsedAndroidLanguages().collect {"\"${it}\""}.join(",") + '}') -@SuppressWarnings(["UnnecessaryQualifiedReference", "SpellCheckingInspection"]) +@SuppressWarnings(["UnnecessaryQualifiedReference", "SpellCheckingInspection", "GroovyUnusedDeclaration"]) static String[] getUsedAndroidLanguages() { Set langs = new HashSet<>() new File('.').eachFileRecurse(groovy.io.FileType.DIRECTORIES) { @@ -28,7 +28,6 @@ static String[] getUsedAndroidLanguages() { new File(it.toString()).eachFileRecurse(groovy.io.FileType.FILES) { if (it.name.toLowerCase().endsWith(".xml") && it.getCanonicalFile().getText('UTF-8').contains("= 21 ? Intent.FLAG_ACTIVITY_NEW_DOCUMENT : Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) | + Intent.FLAG_ACTIVITY_MULTIPLE_TASK); + try { + _context.startActivity(goToMarket); + } catch (ActivityNotFoundException e) { + _context.startActivity(new Intent(Intent.ACTION_VIEW, + Uri.parse("http://play.google.com/store/apps/" + pkgId))); + } + } }