public void onCreate(Bundle savedInstanceState) { try { super.onCreate(savedInstanceState); ctx = this.getApplicationContext(); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow() .setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); ar = new ARLayout(getApplicationContext()); cv = new CustomCameraView(this.getApplicationContext()); requestWindowFeature(Window.FEATURE_NO_TITLE); // cl = new CompassListener(this.getApplicationContext()); WindowManager w = getWindowManager(); Display d = w.getDefaultDisplay(); int width = d.getWidth(); int height = d.getHeight(); ar.screenHeight = height; ar.screenWidth = width; FrameLayout rl = new FrameLayout(getApplicationContext()); rl.addView(cv, width, height); ar.debug = true; rl.addView(ar, width, height); setContentView(rl); LocationManager locMan = (LocationManager) ctx.getSystemService(Context.LOCATION_SERVICE); locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, 100, 1, gpsListener); // Log.e("Where","Orientation:"+i); // rl.bringChildToFront(cl); addLoadingLayouts(); } catch (Exception e) { e.printStackTrace(); } }