title: Display ListView Item(ImageView) to another activity
body: <p>I am having a simple listview with an ImageView and a textView.</p>
  
  <p>Now whenever I click on my listItem I need to send the ImageView to another activity.</p>
  
  <p>I have read many SO answers but couldn't find a better solution for this.</p>
  
  <p>This is my lisview_items.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="match_parent"
                  android:orientation="vertical"&gt;
      &lt;ImageView 
          android:id="@+id/photo"
          android:layout_width="150dip"
                  android:layout_height="100dip"
          android:paddingRight="15dp"
          android:paddingLeft="15dp"/&gt;
      &lt;/LinearLayout&gt;
      &lt;RelativeLayout
      android:layout_width="fill_parent"
                 android:layout_height="match_parent"
                 android:orientation="vertical"
                 android:layout_marginLeft="160dp"
                 android:layout_marginTop="10dp"
                 android:descendantFocusability="blocksDescendants"&gt;
      &lt;TextView android:id="@+id/name"
          android:textSize="14sp" 
          android:textStyle="bold" 
          android:textColor="#000000" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content"/&gt;
  &lt;/RelativeLayout&gt;
  &lt;RelativeLayout&gt;
  </code></pre>
  
  <p>CustomAdapter:</p>
  
  <pre><code>public View getView(final int position, View convertView, ViewGroup parent) {
      ViewHolder holder;
      if (convertView == null) {
          convertView = l_Inflater.inflate(R.layout.item_details_view, null);
          holder = new ViewHolder();
          holder.txt_itemName = (TextView) convertView.findViewById(R.id.name);
          holder.itemImage = (ImageView) convertView.findViewById(R.id.photo);
  
          convertView.setTag(holder);
      } else {
          holder = (ViewHolder) convertView.getTag();
      }
  
      holder.txt_itemName.setText(itemDetailsrrayList.get(position).getName());
               holder.itemImage.setImageResource(imgid[itemDetailsrrayList.get(position).getImageNumber() - 1]);
  }
  </code></pre>
  
  <p>MyListView OnClick:</p>
  
  <pre><code> ArrayList&lt;ItemDetails&gt; image_details = GetSearchResults();
  
      final ListView lv1 = (ListView) findViewById(R.id.list);
      lv1.setAdapter(new ItemListBaseAdapter(this, image_details));
  
  
      OnItemClickListener itemClickListener = new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) { 
  
              Object o = lv1.getItemAtPosition(position);
              ItemDetails obj_itemDetails = (ItemDetails)o;
              Toast.makeText(ListViewImagesActivity.this, "You have chosen : " + " " + obj_itemDetails.getName(), Toast.LENGTH_LONG).show();
              ProductName =obj_itemDetails.getName();
         }  
      };
  </code></pre>
  
  <p>I am using sharedpreferences for sending product name as shown below and it works absolutely fine</p>
  
  <pre><code>SharedPreferences data = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
  data.edit().putString("SelectedProduct", ProductName).commit();
  </code></pre>
  
  <p>In the similar way how do I send the image as it is in ArrayList as shown above..Can anyone shed me some light on this usage</p>