Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In gridView item click </p> <pre><code>Item item =(Item) items.get(position); int id = item.getDrawable(); Intent i = new Intent(ActivityName.this, FullImageActivity.class); i.putExtra("idkey", id); // pass the id startActivity(i); </code></pre> <p>Then in FullImageActivity</p> <pre><code>int id = getIntent().getIntExtra("idkey"); //get id imageview.setImageResource(id); // set the drawable to imageview </code></pre> <p>You can move the below to onCreate of DefaultFridView</p> <pre><code> gridView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long a) { Item item =(Item) items.get(position); int id = item.getDrawable(); Intent i = new Intent(ActivityName.this, FullImageActivity.class); i.putExtra("idkey", id); // pass the id startActivity(i); } }); </code></pre> <p>Also you need to have the List in DefaultGridView</p> <pre><code> List&lt;Item&gt; items = new ArrayList&lt;Item&gt;(); </code></pre> <p>Then</p> <pre><code>items.add(new Item("One", R.drawable.abstact_one)); items.add(new Item("Two", R.drawable.abstract_three)); items.add(new Item("Three", R.drawable.image_two)); items.add(new Item("Four", R.drawable.image_four)); items.add(new Item("Five", R.drawable.image_five)); items.add(new Item("Six", R.drawable.image_nine)); items.add(new Item("Seven", R.drawable.image_ten)); </code></pre> <p>Then</p> <pre><code> gridView.setAdapter(new ImageAdapter(),items); </code></pre> <p>Also i don't understand having the ImageAdapter as separate and as a inner class. WHy do you need both</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload