is there is function for image view that when we press the image button it should show and if we realise button the previous image should show? : <p>i am developing one walkie talkie app in that i am using walkie talkie image button. when i click on that image it should show the different image and when realise that button it should show the previous image . bellow  code walk1 first image and walk2 is second image which should see when image button is clicked </p>

<p>,,,</p>

<pre><code>walk1=findViewById(R.id.walky)
walk2=findViewById(R.id.walky1)
walk1?.setOnLongClickListener {
            walk2?.visibility=View.VISIBLE
            true // Don't consume event, if return false. Consume event if true.
        }
        walk2?.setOnClickListener {
            walk2?.visibility=View.GONE
        }
</code></pre>

<p>,,,
in this code its showing second image but when i realised button its not showing first image when i click again that time its showing </p>
