Issue with launching a new class when clicked on a element in Gridview Android
<p>I have a piece of code that when I clicked on image element in a gridview I want to launch the new class Popup. However, it clashed when I do that right now. what's wrong?</p>

<p><code>Method onCreate():</code></p>

<pre><code>public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    GridView gridview = (GridView) findViewById(R.id.gridview);
    mAdapter=new ImageAdapter(this);

    final Context ctx = this.getApplicationContext();

    gridview.setAdapter(mAdapter);

    gridview.setOnItemClickListener(

        new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,
            long id) {

            // TODO Auto-generated method stub
            Intent i = new Intent(ctx, Popup.class);
            startActivity(i);

            }
        }
    );
</code></pre>

<p><code>Class Popup</code>:</p>

<pre><code>public class Popup extends Activity {


    protected void onCreate(Bundle icicle) {

        super.onCreate(icicle);
        Toast.makeText(getApplicationContext(), "You have selected " +"item",  Toast.LENGTH_SHORT).show();      

    }   

}
</code></pre>

<p>

    
    </p>

<pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
    &lt;activity android:name=".GridView2Activity"
              android:label="@string/app_name"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;
            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;


    &lt;activity android:name=".Popup"&gt;&lt;/activity&gt;

&lt;/application&gt;
</code></pre>

<p></p>
