'Visit website' button from online content menu was not working
This commit is contained in:
@@ -369,10 +369,23 @@ void OSOpenBrowser(const char *url)
|
|||||||
pid_t child_pid = fork();
|
pid_t child_pid = fork();
|
||||||
if (child_pid != 0) return;
|
if (child_pid != 0) return;
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
const char *args[9];
|
||||||
|
args[0] = "/system/bin/am";
|
||||||
|
args[1] = "start";
|
||||||
|
args[2] = "-a";
|
||||||
|
args[3] = "android.intent.action.VIEW";
|
||||||
|
args[4] = "--user";
|
||||||
|
args[5] = "0";
|
||||||
|
args[6] = "-d";
|
||||||
|
args[7] = url;
|
||||||
|
args[8] = NULL;
|
||||||
|
#else
|
||||||
const char *args[3];
|
const char *args[3];
|
||||||
args[0] = "/usr/bin/xdg-open";
|
args[0] = "/usr/bin/xdg-open";
|
||||||
args[1] = url;
|
args[1] = url;
|
||||||
args[2] = NULL;
|
args[2] = NULL;
|
||||||
|
#endif
|
||||||
execv(args[0], const_cast<char * const *>(args));
|
execv(args[0], const_cast<char * const *>(args));
|
||||||
DEBUG(misc, 0, "Failed to open url: %s", url);
|
DEBUG(misc, 0, "Failed to open url: %s", url);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user