Note that there are some explanatory texts on larger screens.

plurals
  1. POKindle Fire and GlSurfaceView.getHeight()
    text
    copied!<p>Im developing a game for the kindle fire, the game always run with the bar hidden.</p> <p>Only when the user enters to the pause menu the bar should appear , I only want that the bar shows up over the game.</p> <p>But it seems that when the bar show up GlSurfaceView.getHeight() changes from 600 to 580, and my game resizes, but I dont want that behavior, </p> <p>I just want that the bar shows up over the game and my game doesnt move , I've already tried with GlSurfaceView.setMinimumHeight(600); </p> <p>but the kindle simply ignores that.</p> <p>this is how my game always runs : <img src="https://i.stack.imgur.com/MnKsQ.png" alt="enter image description here"></p> <p>and when i activate the bar this happens : </p> <p><img src="https://i.stack.imgur.com/7AYtk.png" alt="enter image description here"></p> <p>instead of this : </p> <p><img src="https://i.stack.imgur.com/RAsOJ.png" alt="enter image description here"></p> <p>you know a way to avoid this?</p> <p>Thanks!</p> <p>To create the GlSurfaceView i do the following:</p> <pre><code>OnCreate() { s_activity.m_view = new GameGLSurfaceView(s_activity.getApplication(), true, pixelSize,depthSize, stencilSize); } public GameGLSurfaceView(Context context, boolean translucent,int pixelSize, int depth, int stencil) { super(context); mRenderer = new GameRenderer(context, this); setRenderer(mRenderer); } </code></pre> <p>to Hide and show the bar i use this function</p> <pre><code>private static final int AMAZON_FLAG_NOSOFTKEYS = 0x80000000; private static final int FLAG_SUPER_FULLSCREEN = AMAZON_FLAG_NOSOFTKEYS | WindowManager.LayoutParams.FLAG_FULLSCREEN; public static void toggleKindleBar(final int toDo) { if( s_activity != null) s_activity.runOnUiThread(new Runnable() { public void run() { s_activity.getWindow().clearFlags( toDo!=1? WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN : FLAG_SUPER_FULLSCREEN); s_activity.getWindow().addFlags( toDo!=1? FLAG_SUPER_FULLSCREEN:WindowManager.LayoutParams.FLAG_FULLSCREEN); } }); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload