In Defold, can I hide the system bar of android?The system bar is the bar in the bottom of screen that include back、home、and multitask:
I try to invoke the following code in java, but It crashed.
@SuppressLint(“NewApi”)
public static String hideNavigationBar(Context ctx, String params)
{
if(Build.VERSION.SDK_INT >= 19)
{
Activity act = (Activity)ctx;
Window window = act.getWindow();
View view = window.getDecorView();
int visibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
view.setSystemUiVisibility(visibility);
}
return “”;
}
I found that it crashed in view.setSystemUiVisibility(visibility);