Error when "Select image from gridview and display it on other intent"
<p>I am trying to select image from gridview and display it on other intent.
I saw this solution : <a href="http://stackoverflow.com/questions/11518851/select-image-from-gridview-and-display-it-on-other-intent">Select image from gridview and display it on other intent</a></p>

<p>But I have an error, using the debugger I was able to find that my appli/program quit a this line :</p>

<p>mImage.setImageResource(Constants.mThumbIds[index]);</p>

<p>I checked index's number is good.</p>

<p>My code :
DisplayActivity.java :</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    Bundle bdl=getIntent().getExtras();
    int index=bdl.getInt("Index");      
    ImageView mImage = (ImageView) findViewById(R.id.mImgView1);
    int test = Constante.mThumbIds[index];

    mImage.setImageResource(Constante.mThumbIds[index]);

    setContentView(R.layout.display);
}
</code></pre>

<p>Constante.java</p>

<pre><code>public class Constante {
// references to our images
public static Integer[] mThumbIds = {
     R.drawable.sample_2, R.drawable.sample_3,
     R.drawable.sample_4, R.drawable.sample_5,
     R.drawable.sample_6, R.drawable.sample_7,
     R.drawable.sample_0, R.drawable.sample_1,
     R.drawable.sample_2, R.drawable.sample_3,
     R.drawable.sample_4, R.drawable.sample_5,
     R.drawable.sample_6, R.drawable.sample_7,
     R.drawable.sample_0, R.drawable.sample_1,
     R.drawable.sample_2, R.drawable.sample_3,
     R.drawable.sample_4, R.drawable.sample_5,
     R.drawable.sample_6, R.drawable.sample_7
};}
</code></pre>

<p>Thanks in advance,</p>

<p>Germain.</p>
