feat(Instagram): Add Open links externally patch (#6012)
This commit is contained in:
parent
d238a42708
commit
08e8ead04f
12 changed files with 153 additions and 24 deletions
|
|
@ -15,6 +15,7 @@ import android.content.res.Configuration;
|
|||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
|
@ -696,6 +697,18 @@ public class Utils {
|
|||
}
|
||||
}
|
||||
|
||||
public static void openLink(String url) {
|
||||
try {
|
||||
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(url));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
Logger.printInfo(() -> "Opening link with external browser: " + intent);
|
||||
getContext().startActivity(intent);
|
||||
} catch (Exception ex) {
|
||||
Logger.printException(() -> "openLink failure", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public enum NetworkType {
|
||||
NONE,
|
||||
MOBILE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue