I got two layouts in Kotlin, each with one Button and I just want to switch between both. So I added an OnClickListener to both

```
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        button_foward.setOnClickListener(View.OnClickListener {
            setContentView(R.layout.second)
            button_back.setOnClickListener(View.OnClickListener {
                setContentView(R.layout.activity_main)
            })
        })

```

Well, it is actually working. I can go to the second layout and switch back to the first, but i cannot open the second layout again!

I thought I would have to redefine the Listener after changing back to the main view, so I created two separate functions to set the views.

```
override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        this@MainActivity.createMainScreen()
        })
    }

    fun createMainScreen(){
        setContentView(R.layout.activity_main)
        button_foward.setOnClickListener(View.OnClickListener {
            this@MainActivity.createSecondScreen()
        })
    }
    fun createSecondScreen(){
        setContentView(R.layout.second)
        button_back.setOnClickListener(View.OnClickListener {
            this@MainActivity.createMainScreen()
        })
    }

```

This way was working, when I tried to get rid of the same problem in Java, but in Kotlin i still can use every Button only once. 

How do I solve this? Can (do I have to) reset the Buttons before redefining them?

Or might there be an alternative for the use of setContentView?

Thx for your help!