title: How do you get ANativeWindow from a SurfaceTexture in the NDK
body: <p>I've got some OpenGL ES code that has been rendering to a <code>GLSurfaceView</code>, and I'm currently modifying it to work with either <code>SurfaceView</code> and <code>TextureView</code>.</p>
  
  <p>The common element I need from both inside my native code is: <code>ANativeWindow</code>.</p>
  
  <p>For the <code>SurfaceView</code> I got it by passing <code>Surface</code> to:</p>
  
  <pre><code>m_jwindow = ANativeWindow_fromSurface(env, surface);
  </code></pre>
  
  <p>For <code>TextureView</code>, I take <code>SurfaceTexture</code>, and in API 14 I can use this:</p>
  
  <pre><code>m_jwindow = ANativeWindow_fromSurfaceTexture(env, surface);
  </code></pre>
  
  <p>However, that function was removed in Jellybean. Which leaves me wondering, how can I get <code>ANativeWindow</code> from a <code>SurfaceTexture</code> in API 16+?</p>