I’m making a button in xml(res / layout / activity_home.xml), like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity" >
<ImageView
android:id="@+id/imageView1"
android:src="@drawable/schkopwide"
android:contentDescription="@string/HTI"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="78dp"
android:onclick="Intent i = new Intent(activity_store.xml);
startActivity(i);"
android:text="@string/HTI" />
</RelativeLayout>
so what should I add into this xml to let it redirect to another xml page (res / layout / activity_store.xml)?
Thank you
Try out as below:
In your main activity :
Here is your ActivityStore Class code:
Also add the activity into your mainfest file.