mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
url: put the Android bits in core/android
This commit is contained in:
parent
efd665e2c7
commit
2d82cf78e1
@ -2606,6 +2606,16 @@ int Android_JNI_GetLocale(char *buf, size_t buflen)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
Android_JNI_OpenURL(const char *url)
|
||||||
|
{
|
||||||
|
JNIEnv *env = Android_JNI_GetEnv();
|
||||||
|
jstring jurl = (*env)->NewStringUTF(env, url);
|
||||||
|
const int ret = (*env)->CallStaticIntMethod(env, mActivityClass, midOpenURL, jurl);
|
||||||
|
(*env)->DeleteLocalRef(env, jurl);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __ANDROID__ */
|
#endif /* __ANDROID__ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
@ -129,6 +129,8 @@ SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled);
|
|||||||
/* Request permission */
|
/* Request permission */
|
||||||
SDL_bool Android_JNI_RequestPermission(const char *permission);
|
SDL_bool Android_JNI_RequestPermission(const char *permission);
|
||||||
|
|
||||||
|
int Android_JNI_OpenURL(const char *url);
|
||||||
|
|
||||||
int SDL_GetAndroidSDKVersion(void);
|
int SDL_GetAndroidSDKVersion(void);
|
||||||
|
|
||||||
SDL_bool SDL_IsAndroidTablet(void);
|
SDL_bool SDL_IsAndroidTablet(void);
|
||||||
|
@ -25,11 +25,7 @@
|
|||||||
int
|
int
|
||||||
SDL_SYS_OpenURL(const char *url)
|
SDL_SYS_OpenURL(const char *url)
|
||||||
{
|
{
|
||||||
JNIEnv *env = Android_JNI_GetEnv();
|
return Android_JNI_OpenURL(url);
|
||||||
jstring jurl = (*env)->NewStringUTF(env, url);
|
|
||||||
const int ret = (*env)->CallStaticIntMethod(env, mActivityClass, midOpenURL, jurl);
|
|
||||||
(*env)->DeleteLocalRef(env, jurl);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
Loading…
Reference in New Issue
Block a user