i have a layout and there is a framelayout in this.
i put 2 buttons. and i wanna call activity1 in framelayout when click button1. and so click button2 call activity2 in framelayout.
is this possible?
layout1.xml
<Button
android:id="@+id/button1"
android:layout_width="80dp"
android:layout_height="35dp"
android:background="@drawable/tab_buton"
android:text="@string/turlar"
android:textColor="#ffffff"
android:textSize="12sp"
android:textStyle="bold" android:layout_weight="1"/>
<Button
android:id="@+id/button2"
android:layout_width="80dp"
android:layout_height="35dp"
android:background="@drawable/tab_buton"
android:text="@string/alisveris"
android:textColor="#ffffff"
android:textSize="12sp"
android:textStyle="bold" android:layout_weight="1"/>
</LinearLayout>
<FrameLayout
android:id="@+id/frameLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_below="@+id/linearLayout2"
android:layout_marginLeft="5dp"
android:layout_weight="0.59" android:layout_marginRight="5dp">
</FrameLayout>
activity1.java
public class Firsat extends Base {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout1);
}
when i click button1 call another activity in framlayout.
No, that is not possible. Activities can’t be nested. Opening activity 2 will pust Activity 1 to the backstack. You can use fragments for the job though.