Each element in a layout needs to have a unique id. you have identified both screen elements as @+id/surfaceView. Try making them both unique. See modified layout file below - also don't forget to update your source code to populate both screen elements.
Add code to your program to reference both SurfaceView objects. You just duplicate the code you already have. You should also check the rest of your program for other references to your SurfaceView object that need to be updated.
surfaceViewLeft = (SurfaceView) findViewById(R.id.surfaceViewLeft);
surfaceHolderLeft = surfaceViewLeft.getHolder();
// Install a SurfaceHolder.Callback so we get notified when the
// underlying surface is created and destroyed.
// deprecated setting, but required on Android versions prior to 3.0
surfaceViewRight = (SurfaceView) findVi
Asked in February 2016Viewed 3,686 timesVoted 7Answered 1 times