I'm a little confused as to what I should be doing. I've read about fragments and I'm not sure if I should be using them here. I have 3 button in my main\_layout file. What I'm doing incorrectly (I know) is that I have 3 different (but really similar) result xml files and 3 activity.java files. The result page is the same, just different text. There's no reason to have so many java files etc. I know there has to be a better way?

In my main\_layout.xml, I have 3 ImageButtons:

![enter image description here](https://i.stack.imgur.com/f5UqL.png)

In my MainActivity.java:

```
ImageButton ib1 = (ImageButton) findViewById(R.id.imageButton1);
ib1.setOnClickListener(this);

ImageButton ib2 = (ImageButton) findViewById(R.id.imageButton2);
ib2.setOnClickListener(this);

ImageButton ib3 = (ImageButton) findViewById(R.id.imageButton3);
ib3.setOnClickListener(this);

public void onClick(View v) {
    if (v.getId() == R.id.imageButton1) {
        startActivity(new Intent(Main.this, OneInfo.class));
    } else if (v.getId() == R.id.imageButton2) {
        startActivity(new Intent(Main.this, TwoInfo.class));
    } else if (v.getId() == R.id.imageButton3) {
        startActivity(new Intent(Main.this, ThreeInfo.class));

```