Open new activity by clicking the button in fragment android -


i use swipe action tab have 3 tabs (tab 1,tab 2,tab 3)

how can open new activity clicking button in fragment android

in tab 1 page there multiple buttons want click example button 1 open new page how can that?

how can open new page fragment ?

<?xml version="1.0" encoding="utf-8"?>     <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent"        android:layout_height="match_parent"         android:orientation="vertical"         android:background="#2e2e2e" >     <button             android:id="@+id/button1"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_alignparentleft="true"             android:layout_alignparenttop="true"             android:layout_margintop="15dp"             android:background="#00b3ff"             android:text="button 1"             android:textcolor="#ffffff"             android:textcolorhint="#ffffff"             android:textsize="22sp"             android:textstyle="bold" />      <button         android:id="@+id/button2"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_alignleft="@+id/button1"             android:layout_below="@+id/button1"             android:layout_margintop="15dp"             android:background="#00b3ff"             android:text="button 2"              android:textcolor="#ffffff"             android:textcolorhint="#ffffff"             android:textsize="22sp"             android:textstyle="bold"/>         </relativelayout> 

you can this:

yourbutton.setonclicklistener(new view.onclicklistener(){     @override     public void onclick(view v){         intent intent = new intent(getactivity(),nextactivity.class);         getactivity().startactivity(intent);     } }); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -