I have an augmented reality app that shows the the camera view and a GLSurfaceView with a polygon that can be rotated touching the screen. The main layout of my app is a FrameLayout. The frameLayout contains the cameraView and the GLSurfaceView. My app also have two buttons on the screen (zoom in/out) on a RelativeLayout overlaying the cameraView.
The problem is that the cameraview is overlapping the other two views (the zoom buttons, and the GLSurfaceView with the polygon), i only can see the cameraView on the screen. If i remove the cameraview from the main FrameLayout of my app then i can see the GLSurfaceView and the zoom buttons without problems. How can i solve this? i need that the GLSurfaceView overlays the cameraView and the RelativeLayout with the zoom buttons overlays the GLSurfaceView... THis is the code: public class ARLambo3DSample extends Activity { private CustomCameraView cv=null; private ImageView minus; private ImageView plus; private MySurfaceView mySurfaceView; private boolean pressed=false; //algĂșn boton de zoom pulsado private boolean zoomIn=false; //si zoomIn=true entonces hace zoomIn y si es false hace zoomOut private myThread t1; //Hilo que gestiona el zoomIn y el zoomOut public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FrameLayout fl = new FrameLayout(this.getApplicationContext()); cv = new CustomCameraView(this.getApplicationContext()); RelativeLayout rl= new RelativeLayout(this.getApplicationContext()); //turn off the window's title bar requestWindowFeature(Window.FEATURE_NO_TITLE); //fullscreen this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); fl.addView(cv); minus= new ImageView(getApplicationContext()); minus.setImageResource(R.drawable.minus2); rl.addView(minus); plus= new ImageView(getApplicationContext()); plus.setImageResource(R.drawable.plus2); rl.addView(plus); Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); int w = display.getWidth(); int h = display.getHeight(); RelativeLayout.LayoutParams minusPosition = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); RelativeLayout.LayoutParams plusPosition = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); minusPosition.leftMargin = (int)(w*0.77); minusPosition.topMargin = (int)(h*0.80); //0.66 si no es fullscreen minus.setLayoutParams(minusPosition); plusPosition.leftMargin = (int)(w*0.88); plusPosition.topMargin = (int)(h*0.80); plus.setLayoutParams(plusPosition); mySurfaceView = new MySurfaceView(this); setContentView(fl); plus.setClickable(true); //esto es necesario para poder gestionar cuando el boton se presiona y se suelta minus.setClickable(true); //esto es necesario para poder gestionar cuando el boton se presiona y se suelta minus.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: //boton presionado zoomIn=false; pressed=true; break; case MotionEvent.ACTION_UP: //boton se suelta pressed=false; break; } return false; } }); plus.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: //boton presionado zoomIn=true; pressed=true; break; case MotionEvent.ACTION_UP: //boton se suelta pressed=false; break; } return false; } }); t1= new myThread(); t1.start(); fl.addView(mySurfaceView); fl.addView(rl); } protected void onResume() { super.onResume(); mySurfaceView.onResume(); } protected void onPause() { super.onPause(); mySurfaceView.onPause(); } } -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en