According to the description of Android developers FrameLayout
Child modes are drawn on the stack, with the last child added on top.
So, in your xml, LinearLayout last LinearLayout drawn, and since it has match_parent attributes, it completely hides your drawing surface.
So try using RelativeLayout and set the LinearLayout attributes LinearLayout only wrap_content , something like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg2" > <com.myapp.drawings.DrawingSurface android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/drawingSurface" /> <LinearLayout android:orientation="horizontal" android:background="@drawable/bg2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true"> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="OK" android:onClick="onClick" android:id="@+id/colorBlueBtn" /> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Save" android:onClick="onClick" android:id="@+id/saveBtn" /> </LinearLayout> </RelativeLayout>
You can also completely exclude LinearLayout , and just set the button attributes so that they stay below, etc.
source share