I have a activity with only 2 buttons and a FrameLayout:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/linearLayout">
<Button
android:id="@+id/btPrincipal1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ver Fragment 1"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
/>
<Button
android:id="@+id/btPrincipal2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ver Fragment 2"
android:layout_gravity="center_horizontal"
android:layout_weight="1"/>
</LinearLayout>
<FrameLayout
android:layout_width="250dp"
android:layout_height="match_parent"
android:id="@+id/contenedor"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_below="@+id/linearLayout">
</FrameLayout>
When I click button 1, I call the fragment and, when I click button 2, I want to call the same fragment but with different properties. For example:
I click button 1 , call fragment A with background color green.
I click button 2 , call fragment A with background color red.
It's possible? and how can I do this? Thanks.