Buggy code:
private static final int DIALOG_STORE_CONT = 102 ; private static final String NATIVE_LIB_SAMPLE = "ImageTargets" ; private static final String NATIVE_LIB_QCAR = "QCAR" ; private int currentLevel ; private QCARSampleGLView mGlView ; private ImageTargetsRenderer mRenderer ; private GUIManager mGUIManager ; private int mScreenWidth = 0 ; private int mScreenHeight = 0 ; private int mAppStatus = ImageTargets . APPSTATUS_UNINITED ; private ImageTargets . InitQCARTask mInitQCARTask ; private ImageTargets . LoadTrackerTask mLoadTrackerTask ; private int mQCARFlags = 0 ; private Vector < Texture > mTextures ; public static native void nativeBuy ( int cost ) { } public static native void nativeNext ( ) { } public native void initNativeCallback ( ) { } private class InitQCARTask extends AsyncTask < Void , Integer , Boolean > { private int mProgressValue = - 1 ; protected Boolean doInBackground ( Void ... params ) { } protected void onProgressUpdate ( Integer ... values ) { } protected void onPostExecute ( Boolean result ) { } } private class LoadTrackerTask extends AsyncTask < Void , Integer , Boolean > { protected Boolean doInBackground ( Void ... params ) { } protected void onProgressUpdate ( Integer ... values ) { } protected void onPostExecute ( Boolean result ) { } } public Dialog onCreateDialog ( int id ) { } private GestureDetector mGestureDetector ; protected void onCreate ( Bundle savedInstanceState ) { } private void loadTextures ( ) { } private int getInitializationFlags ( ) { } public native int getOpenGlEsVersionNative ( ) { } public native void onQCARInitializedNative ( ) { } private native void startCamera ( ) { } private native void stopCamera ( ) { } protected void onResume ( ) { } protected void onPause ( ) { } private native void deinitApplicationNative ( ) { } protected void onDestroy ( ) { } @ Override public void onBackPressed ( ) { } private synchronized void updateApplicationStatus ( int appStatus ) { if ( ( mAppStatus ) == appStatus ) return ; mAppStatus = appStatus ; switch ( mAppStatus ) { case ImageTargets . APPSTATUS_INIT_APP : initApplication ( ) ; initNativeCallback ( ) ; updateApplicationStatus ( ImageTargets . APPSTATUS_INIT_MENU ) ; break ; case ImageTargets . APPSTATUS_INIT_MENU : setContentView ( main ) ; Button StartGameButton = ( ( Button ) ( findViewById ( new_game_button ) ) ) ; StartGameButton . setOnClickListener ( new OnClickListener ( ) { public void onClick ( View v ) { updateApplicationStatus ( ImageTargets . APPSTATUS_INIT_QCAR ) ; } } ) ; Button GameRulesButton = ( ( Button ) ( findViewById ( game_rules_button ) ) ) ; GameRulesButton . setOnClickListener ( new OnClickListener ( ) { public void onClick ( View v ) { setContentView ( game_rules ) ; } } ) ; Button SettingsButton = ( ( Button ) ( findViewById ( settings_button ) ) ) ; SettingsButton . setOnClickListener ( new OnClickListener ( ) { public void onClick ( View v ) { } } ) ; Button CreditsButton = ( ( Button ) ( findViewById ( credits_button ) ) ) ; CreditsButton . setOnClickListener ( new OnClickListener ( ) { public void onClick ( View v ) { setContentView ( credits ) ; } } ) ; break ; case ImageTargets . APPSTATUS_INIT_QCAR : try { mInitQCARTask = new ImageTargets . InitQCARTask ( ) ; mInitQCARTask . execute ( ) ; } catch ( Exception e ) { DebugLog . LOGE ( "Initializing<seq2seq4repair_space>QCAR<seq2seq4repair_space>SDK<seq2seq4repair_space>failed" ) ; } break ; case ImageTargets . APPSTATUS_INIT_APP_AR : initApplicationAR ( ) ; updateApplicationStatus ( ImageTargets . APPSTATUS_INIT_TRACKER ) ; break ; case ImageTargets . APPSTATUS_INIT_TRACKER : try { mLoadTrackerTask = new ImageTargets . LoadTrackerTask ( ) ; mLoadTrackerTask . execute ( ) ; } catch ( Exception e ) { DebugLog . LOGE ( "Loading<seq2seq4repair_space>tracking<seq2seq4repair_space>data<seq2seq4repair_space>set<seq2seq4repair_space>failed" ) ; } break ; case ImageTargets . APPSTATUS_INITED : System . gc ( ) ; onQCARInitializedNative ( ) ; Handler handler = new Handler ( ) ; handler . postDelayed ( new Runnable ( ) { public void run ( ) { mRenderer . mIsActive = true ; <START_BUG> addContentView ( mGlView , new LayoutParams ( LayoutParams . FILL_PARENT , LayoutParams . FILL_PARENT ) ) ; <END_BUG> addContentView ( mGUIManager . getOverlayView ( ) , new LayoutParams ( LayoutParams . FILL_PARENT , LayoutParams . FILL_PARENT ) ) ; mGUIManager . initButtons ( ) ; Button storeButton ; storeButton = ( ( Button ) ( mGUIManager . getOverlayView ( ) . findViewById ( store_button ) ) ) ; storeButton . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View v ) { mGUIManager . nativeStore ( ) ; showDialog ( ImageTargets . DIALOG_STORE ) ; } } ) ; updateApplicationStatus ( ImageTargets . APPSTATUS_CAMERA_RUNNING ) ; } } , 0 ) ; break ; case ImageTargets . APPSTATUS_CAMERA_STOPPED : stopCamera ( ) ; break ; case ImageTargets . APPSTATUS_CAMERA_RUNNING : startCamera ( ) ; break ; default : throw new RuntimeException ( "Invalid<seq2seq4repair_space>application<seq2seq4repair_space>state" ) ; } } private native void setActivityPortraitMode ( boolean isPortrait ) { } private void initApplication ( ) { } private native void initApplicationNative ( int width , int height ) { } private void initApplicationAR ( ) { } public boolean onCreateOptionsMenu ( Menu menu ) { } public boolean onOptionsItemSelected ( MenuItem item ) { } private MenuItem checked ; private boolean mFlash = false ; private native boolean toggleFlash ( boolean flash ) { } private native boolean autofocus ( ) { } private native boolean setFocusMode ( int mode ) { } public void updateEOL ( String level ) { } public int getTextureCount ( ) { } public Texture getTexture ( int i ) { } public static boolean loadLibrary ( String nLibName ) { } @ Override public boolean onTouchEvent ( MotionEvent event ) { } private native boolean nativeTapEvent ( float tapX , float tapY ) { } class TapGestureListener extends GestureDetector . SimpleOnGestureListener { @ Override public boolean onSingleTapUp ( MotionEvent ev ) { } } }

Fix:
setContentView ( mGlView , new LayoutParams ( LayoutParams . FILL_PARENT , LayoutParams . FILL_PARENT ) ) ;