my smartphone has softkeys which i want to hide permanently in my APP. i use that function below to hide the softkeys.
public void setFullscreen(boolean fullscreen) {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
if (fullscreen) {
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
attrs.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
attrs.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
}
else {
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
attrs.flags &= ~WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
attrs.flags &= ~WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
}
getWindow().setAttributes(attrs);
View v = this.getWindow().getDecorView();
v.setSystemUiVisibility(View.GONE);
}
i call that function in all activitys in onCreate, before protected void onCreate(Bundle savedInstanceState) like so..
@Override
protected void onCreate(Bundle savedInstanceState)
{
setFullscreen(true);
super.onCreate(savedInstanceState);
setContentView(R.layout.myLayout);
}
the problem: i am changing the activity and the softkeys appear and hide again. how do i prevent them from appearing?
i also use "stateHidden" in the manifest for all activitys
<activity
android:name=".myActivity"
android:windowSoftInputMode="stateHidden" />
hope you can help me out... big thanks! :)