I have FrameLayout like this:
FrameLayout should be used to hold a single child view
, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other.
You should use LinearLayout or RelativeLayout in FrameLayout . Like this way
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="changeColor"
android:text="new button"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="some text"/>
</RelativeLayout>
</FrameLayout>