mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-26 22:20:20 +00:00
Fix browser not opening in certain contexts.
Fixes #14368 Resolves #14388
This commit is contained in:
@@ -229,6 +229,9 @@ public class CommunicationActions {
|
||||
public static void openBrowserLink(@NonNull Context context, @NonNull String link) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
|
||||
if (!(context instanceof Activity)) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
context.startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(context, R.string.CommunicationActions_no_browser_found, Toast.LENGTH_SHORT).show();
|
||||
|
||||
Reference in New Issue
Block a user