Can't get Image from drawable by code
<p>I have an Imageview that when user clicks on it a dialog box opens and it is suppose to show image larger within it. <br />
the Imageview I have is in a layout and the code is this:
ImageView image_terrain = (ImageView)findViewById(R.id.imageView2);
        image_terrain.setOnClickListener(new OnClickListener() {</p>

<pre><code>        public void onClick(View v) {

            Intent intent = new Intent(getApplicationContext(), Universitymap.class);
            intent.putExtra("imageName", "sattelite");

            Dialog d = new Dialog(Universitymap.this);
            d.setContentView(R.layout.image_dialog);
            d.show();
        }
    });
</code></pre>

<p>I use intent for sending which picture clicked by sending it's name. <br /></p>

<p>now in image_dialog layout I have this code: <br /></p>

<pre><code>Intent intent = new Intent();
String fileName = intent.getExtras().getString("imageName");
loadImage(fileName);
</code></pre>

<p>and the funtion that loads image in image_dialog layout class is: <br /></p>

<pre><code>private void loadImage(String fileName){
    ImageView img = (ImageView)findViewById(R.id.img_Picture);
    int resID = getResources().getIdentifier(fileName, "drawable", "com.neema.smobile.Main");
    img.setImageResource(resID);
}
</code></pre>

<p>one word = it doesn't work. I would be happy if anyone help.</p>
