I am making a game on landscape mode.
When I hide the navigation bar, there is an error
Birds are shown on the navigation bar.
I code this on GameActivity
public class GameActivity extends AppCompatActivity {
private GameView gameView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
View decorView = getWindow().getDecorView();
int uniOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uniOptions);
Point point = new Point();
getWindowManager().getDefaultDisplay().getSize(point);
gameView = new GameView(this, point.x, point.y);
setContentView(gameView);
}
And I added it on Manifest
android:screenOrientation="landscape"
When I do this on portrait, it works well. But I need this game on landscape mode. How can I hide nav bar without an error?