Android Studio onClick button to display ImageView in another activity
<p>I have setup 2 activities - one and two . </p>

<p>For activity 1, I have a <code>EditText</code> and a button. When user open the app, it will show Activity One(just like the screenshot) to prompt user to key in a number. For example, 1 or 2. </p>

<p>What I am trying to do is that: I want to display a <code>ImageView</code> in activity 2 when user key in a number in <code>EditText</code>follow by a click on the button in activity 1. </p>

<ul>
<li>If user key in 1, it will display <code>1.png</code> in activity 2</li>
<li>If user key in 2, it will display <code>2.png</code> in activity 2</li>
<li>If user key in 3, it will display <code>3.png</code> in activity 2
etc...</li>
</ul>

<p>the image will get from <code>drawable</code> folder.</p>

<p><strong>Please refer to this screenshot</strong></p>

<p>[![enter image description here][1]][1]</p>

<p><strong>I can pass the integer value through <code>Intent</code> from activity 1 to 2 but I can't do it for ImageView</strong>. so that means the if else loop i have already done just that the <code>ImageView</code> cant display. </p>

<pre><code> get_image.setBackgroundResource(R.drawable.1); //  here i can only key in 01 ( it will get image from Drawable folder 1.png). i cant put int value into it. 
</code></pre>

<p>Or i shouldn't use get_image.setBackgroundResource?? Anyone can help? I stuck here for 1 day... </p>

<p>thanks in advance! </p>

<p>please check screenshot -> <a href="http://i.stack.imgur.com/53vjy.jpg" rel="nofollow">http://i.stack.imgur.com/53vjy.jpg</a></p>