title: pass data to new activity from adapter class
body: <p>I made one <strong>custom listview</strong> with image and text.When u <strong>click on image</strong> it ll lead you to new activity.Now i want to <strong>pass image and text</strong> to new activity.i know with <strong>putExtra</strong> method you can pass data but i don't know how can i use it here..
  <em>thanks</em> in advance...
  here is my code for <strong>adapter class</strong>..</p>
  
  <p>Note..I am parsing data from json</p>
  
  <p>Onclick method is used to go on another activity...</p>
  
  <pre><code> public class Adapter extends BaseAdapter {
  
  private static final String TAG = "Adapter";
  private Activity mActivity;
  public ArrayList&lt;Data&gt; mObjects;
  // /private final Context context;
  Context context;
  
  static class ViewHolder {
      static ImageView icon;
      TextView title;
      TextView name;
      TextView review;
      DownloadImageTask mTask;
      String ab[];
      // DownloadImageTask1 mTask1;
      // ImageView photo;
  }
  
  public Adapter(Activity activity, Context context, ArrayList&lt;Data&gt; mObjects) {
  
      this.mActivity = (Activity) activity;
      this.context = context;
      this.mObjects = mObjects;
  
  }
  
  public void setObjects(ArrayList&lt;Data&gt; mObjects) {
      this.mObjects = mObjects;
  }
  
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
  
      Data item = mObjects.get(position);
      View rowView = convertView;
  
      if (rowView == null) {
          LayoutInflater inflater = mActivity.getLayoutInflater();
          rowView = inflater.inflate(R.layout.item, parent, false);
          ViewHolder viewHolder = new ViewHolder();
          viewHolder.icon = (ImageView) rowView.findViewById(R.id.image);
          // viewHolder.photo = (ImageView) rowView.findViewById(R.id.photo);
          viewHolder.title = (TextView) rowView.findViewById(R.id.title);
          viewHolder.name = (TextView) rowView.findViewById(R.id.name);
  
          viewHolder.review = (TextView) rowView.findViewById(R.id.status);
          rowView.setTag(viewHolder);
      }
  
      ViewHolder holder = (ViewHolder) rowView.getTag();
  
      holder.title.setText(item.getmTitle());
      holder.name.setText(item.getmConcatinate());
  
      holder.review.setText(item.getmreview());
      holder.icon.setBackgroundResource(R.drawable.ic_ab);
      // holder.photo.setBackgroundResource(0);
      holder.mTask = new DownloadImageTask(item.getmImageUrl(), holder.icon);
      if (!holder.mTask.isCancelled()) {
          holder.mTask.execute();
      }
  
      ViewHolder.icon.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Log.d("Parsing JSON Data", "Before user try122222"); // perform
                                                                      // action
              Intent intent = new Intent(v.getContext(), LargeView.class);
  
              v.getContext().startActivity(intent);
  
          }
      });
  
      // holder.mTask1 = new DownloadImageTask1(item.getmImageUrl1(),
      // holder.photo);
      // if (!holder.mTask1.isCancelled()) {
      // holder.mTask1.execute();
      // }
  
      return rowView;
  }
  
  @Override
  public int getCount() {
  
      return (this.mObjects.size());
  }
  
  @Override
  public Object getItem(int position) {
  
      return (this.mObjects.get(position));
  }
  
  @Override
  public long getItemId(int position) {
  
      return (position);
  }
  
  public AbsListView.RecyclerListener mRecyclerListener = new RecyclerListener() {
  
      public void onMovedToScrapHeap(View view) {
          ViewHolder viewHolder = (ViewHolder) view.getTag();
          DownloadImageTask imagetask = viewHolder.mTask;
          // DownloadImageTask1 imagetask1 = viewHolder.mTask1;
          if (imagetask != null) {
              imagetask.cancel(true);
          }
          // if (imagetask1 != null) {
          // // imagetask1.cancel(true);
          // }
      }
  
  };
  </code></pre>
  
  <p>code in main activity.class</p>
  
  <pre><code>     @Override
  protected void onCreate(Bundle savedInstanceState) {
      StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
              .detectAll().penaltyLog().build();
      StrictMode.setThreadPolicy(policy);
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_profile3);
  
      name = (TextView) findViewById(R.id.textView1);
      bmImage2 = (ImageView) findViewById(R.id.imageView1);
      address = (TextView) findViewById(R.id.textView2);
      gender = (TextView) findViewById(R.id.textView3);
      loyalitypoints = (TextView) findViewById(R.id.textView7);
      followers = (TextView) findViewById(R.id.textView8);
      following = (TextView) findViewById(R.id.textView9);
      // list13 = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();
      mListView = (ListView) findViewById(android.R.id.list);
      mListView.setClickable(true);
  
  
  
  
  
  
      // mListView=(ListView)findViewById(R.id.list);
      mAdapter = new Adapter(this,c,mSource );
      mListView.setAdapter(mAdapter);
      Log.w("Parsing JSON Data", "Before Item click");
  
      mListView.setRecyclerListener(mAdapter.mRecyclerListener);
  
   }
  
  
          public String getJSONfromURL(String url) {
      InputStream is = null;
      String result = "";
  
      // http post
      try {
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost(url);
          HttpResponse response = httpclient.execute(httppost);
          HttpEntity entity = response.getEntity();
          is = entity.getContent();
  
      } catch (Exception e) {
          Log.e("log_tag", "Error in http connection " + e.toString());
      }
  
      // convert response to string
      try {
          BufferedReader reader = new BufferedReader(new InputStreamReader(
                  is, "iso-8859-1"), 8);
          StringBuilder sb = new StringBuilder();
          String line = null;
          while ((line = reader.readLine()) != null) {
              sb.append(line + "\n");
          }
          is.close();
          result = sb.toString();
  
      } catch (Exception e) {
          Log.e("log_tag", "Error converting result " + e.toString());
      }
      return result;
  }
  </code></pre>