1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add core.open_url() to main menu API (#8592)

This commit is contained in:
rubenwardy 2020-05-17 19:09:10 +01:00 committed by GitHub
parent c1ce4be756
commit a9c3a42323
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 98 additions and 96 deletions

View file

@ -213,6 +213,18 @@ void showInputDialog(const std::string &acceptButton, const std::string &hint,
jacceptButton, jhint, jcurrent, jeditType);
}
void openURLAndroid(const std::string &url)
{
jmethodID url_open = jnienv->GetMethodID(nativeActivity, "openURL",
"(Ljava/lang/String;)V");
FATAL_ERROR_IF(url_open == nullptr,
"porting::openURLAndroid unable to find java openURL method");
jstring jurl = jnienv->NewStringUTF(url.c_str());
jnienv->CallVoidMethod(app_global->activity->clazz, url_open, jurl);
}
int getInputDialogState()
{
jmethodID dialogstate = jnienv->GetMethodID(nativeActivity,