Asking for name of image in if statement
<p>My Question is, how to ask in if statement for the name of an image in a ImageView. I have tried it with image.equals("imageName") but it doesn't work.
I will display Random images my Code looks like:</p>

<pre><code>Random rand = new Random();
String str = "img_" + rand.nextInt(3);
</code></pre>

<p>In the if statement I have tried this:</p>

<pre><code>if (str.equals("img_" + 1)){...}
</code></pre>

<p>And my ImageView, wich shows a Random image (this works fine) looks like this:</p>

<pre><code>image = (ImageView) findViewById(R.id.imageView);
image.setImageDrawable(getResources().getDrawable(getResourceID(str, "drawable", getApplicationContext())));
</code></pre>

<p>I think, i have to handle with "image" and not "str" but i don't know how???</p>