[Android] Hide the navigation bar

This commit is contained in:
Jonathan De Wachter 2014-06-20 03:28:43 +02:00
parent a88bab1d59
commit f0345d5201

View File

@ -421,6 +421,24 @@ void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_
ANativeActivity_setWindowFlags(activity, AWINDOW_FLAG_FULLSCREEN,
AWINDOW_FLAG_FULLSCREEN);
// Hide the navigation bar
JavaVM* lJavaVM = activity->vm;
JNIEnv* lJNIEnv = activity->env;
jobject objectActivity = activity->clazz;
jclass classActivity = lJNIEnv->GetObjectClass(objectActivity);
jmethodID methodGetWindow = lJNIEnv->GetMethodID(classActivity, "getWindow", "()Landroid/view/Window;");
jobject objectWindow = lJNIEnv->CallObjectMethod(objectActivity, methodGetWindow);
jclass classWindow = lJNIEnv->FindClass("android/view/Window");
jmethodID methodGetDecorView = lJNIEnv->GetMethodID(classWindow, "getDecorView", "()Landroid/view/View;");
jobject objectDecorView = lJNIEnv->CallObjectMethod(objectWindow, methodGetDecorView);
jclass classView = lJNIEnv->FindClass("android/view/View");
jmethodID methodsetSystemUiVisibility = lJNIEnv->GetMethodID(classView, "setSystemUiVisibility", "(I)V");
lJNIEnv->CallVoidMethod(objectDecorView, methodsetSystemUiVisibility, (jint)(2 | 4));
// Initialize the display
eglInitialize(states->display, NULL, NULL);