I want to make a button that allow user to go back to the previous page when click. Just work like the physical back button on the android device. What should I add to the java file?
here is the code(xml):
<Button
android:id="@+id/button00"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:text="@string/st_pp"
android:textColor="#01646d"
android:background="#fef200"/>
here is the code(java):
bn00.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent it1 = new Intent(getApplicationContext(), Main.class);
startActivity(it1);
}
});