2727import android .content .IntentFilter ;
2828import android .content .SharedPreferences ;
2929import android .content .pm .PackageManager ;
30- import android .net .Uri ;
3130import android .os .Bundle ;
3231import android .os .Handler ;
3332import android .os .Looper ;
@@ -996,19 +995,18 @@ private void showKeepAndroidDialog() {
996995 "pt" , "cs" , "sk" , "fa" , "ar" , "tr" , "el" , "th" , "ru" , "uk" , "ko" , "zh" , "ja" );
997996 final var locale = Localization .getAppLocale ();
998997 final String kaoBaseUrl = "https://keepandroidopen.org/" ;
999- final String kaoURIString ;
998+ final String kaoURI ;
1000999 if (supportedLannguages .contains (locale .getLanguage ())) {
10011000 if ("zh" .equals (locale .getLanguage ())) {
1002- kaoURIString = kaoBaseUrl + ("TW" .equals (locale .getCountry ()) ? "zh-TW" : "zh-CN" );
1001+ kaoURI = kaoBaseUrl + ("TW" .equals (locale .getCountry ()) ? "zh-TW" : "zh-CN" );
10031002 } else {
1004- kaoURIString = kaoBaseUrl + locale .getLanguage ();
1003+ kaoURI = kaoBaseUrl + locale .getLanguage ();
10051004 }
10061005 } else {
1007- kaoURIString = kaoBaseUrl ;
1006+ kaoURI = kaoBaseUrl ;
10081007 }
1009- final var kaoURI = Uri .parse (kaoURIString );
1010- final var solutionURI = Uri .parse (
1011- "https://github.com/woheller69/FreeDroidWarn?tab=readme-ov-file#solutions" );
1008+ final var solutionURI =
1009+ "https://github.com/woheller69/FreeDroidWarn?tab=readme-ov-file#solutions" ;
10121010
10131011 if (kaoLastCheck .plus (30 , ChronoUnit .DAYS ).isBefore (now )) {
10141012 final var dialog = new AlertDialog .Builder (this )
@@ -1030,10 +1028,10 @@ private void showKeepAndroidDialog() {
10301028 // If we use setNeutralButton and etc. dialog will close after pressing the buttons,
10311029 // but we want it to close only when positive button is pressed
10321030 dialog .getButton (AlertDialog .BUTTON_NEGATIVE ).setOnClickListener (v ->
1033- this . startActivity ( new Intent ( Intent . ACTION_VIEW , kaoURI ) )
1031+ ShareUtils . openUrlInBrowser ( this , kaoURI )
10341032 );
10351033 dialog .getButton (AlertDialog .BUTTON_NEUTRAL ).setOnClickListener (v ->
1036- this . startActivity ( new Intent ( Intent . ACTION_VIEW , solutionURI ) )
1034+ ShareUtils . openUrlInBrowser ( this , solutionURI )
10371035 );
10381036 }
10391037 }
0 commit comments