I wanted to have 80 pages in my app, that look like the following code. I can go from one page to the next over two buttons. Because I don't want to create 80 activities, I have to connect the 80 pages in one activity. How does that work?
package com.example.xxx;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class PictureOne extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.pictureone);}
public void Picture0 (View view){
Intent i = new Intent(this, PageZero.class);
startActivity(i);}}
public void Picture2 (View view){
Intent i = new Intent(this, PageTwo.class);
startActivity(i);}}
XML:
<?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" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:layout_marginLeft="14dp"
android:src="@drawable/pic1" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/left"
android:onClick="Picture0"/>
<ImageView
android:id="@+id/imageView4"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/right"
android:onClick="Picture2"/>
</RelativeLayout>