I had done a glSurfaceView embedded inside a layout using android, and there are some buttons on the leftside of glSurfaceView. By clicking that button a new glSurfaceView should be created on the previous one.
How could I do that? As in this com.example.activity.MyGlSurfaceView is always constant, how can I make it dynamically change it?
<Linearlayout .....>
<include android:id="@+id/title_btn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
layout="@layout/option_button"/>
<com.example.activity.MyGlSurfaceView
android:id="@+id/gl_surface_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="8"/>
</Linearlayout>
hope it could be the answer for your question
this is my first answer XD
Added:
I am not sure this would suit for your case but it doesn’t make error on my phone.