android: VersionPreference: Handle no-browser-installed case
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
0e3e3ae37b
commit
5c9643a23b
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package com.wireguard.android.preference;
|
package com.wireguard.android.preference;
|
||||||
|
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -46,7 +47,9 @@ public class VersionPreference extends Preference {
|
|||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
final Intent intent = new Intent(Intent.ACTION_VIEW);
|
final Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
intent.setData(Uri.parse("https://www.wireguard.com/"));
|
intent.setData(Uri.parse("https://www.wireguard.com/"));
|
||||||
|
try {
|
||||||
getContext().startActivity(intent);
|
getContext().startActivity(intent);
|
||||||
|
} catch (final ActivityNotFoundException ignored) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user