Question: Im doing the front-end of my new app on android, and I came across with a problem.
On my first Activity my button works fine and take the user to the second Activity, now the problem appear.
When I click on another button to take me to a third Activity nothing happens.

```
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ImageButton saldoButton = (ImageButton)findViewById(R.id.saldoButton);

    saldoButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            setContentView(R.layout.activity_saldo);

        }
    });
}

```

now follow my xml of this button:

```
            <ImageButton
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:id="@+id/saldoButton"
            android:layout_column="2"
            android:background="?android:attr/selectableItemBackground"
            android:src="@drawable/test02" />

```

Anyone has a clue what is happening?

Answer: 
You have to start third activity

```
saldoButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
             Intent i= new Intent(currentActivity.this,thirdActivity.class);
             startActivity(i);

        }
    });

```
Since you are inflating a new layout, you need to call once again `findViewById` to regain access to your ImageView since the ID of your button in one layout layout is not the same in another layout.

```
saldoButton.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        setContentView(R.layout.activity_saldo);
        saldoButton = (ImageView) findViewById(R.id.saldoButton);
    }
});

```

That being said, you should create another activity or another fragment instead of inflating another layout.