'Visit website' button from online content menu was not working

This commit is contained in:
pelya
2014-07-20 00:05:53 +03:00
parent c7950af003
commit 58c998aabc

View File

@@ -369,10 +369,23 @@ void OSOpenBrowser(const char *url)
pid_t child_pid = fork();
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];
args[0] = "/usr/bin/xdg-open";
args[1] = url;
args[2] = NULL;
#endif
execv(args[0], const_cast<char * const *>(args));
DEBUG(misc, 0, "Failed to open url: %s", url);
exit(0);