In this method I am receiving the ArrayList
OkHttpHandler handler = new OkHttpHandler(MainActivity.this,new OkHttpHandler.MyInterface() {
You can do this using following way
You can set position of a grid item(here image) you click as a tag to imageview and then you can get the json object or single object from array list using above position and can send to another activity.
holder.imageView.SetTag(position)
holder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//Get your imageview here by using v.findviewbyid and get tag tag
//Like this
//ImageView iv=(ImageView)v.findviewbyid(id of layout you mention to bind holder.imageView)
//Integer mPosition=(Integer)iv.getTag();
//Then fetch that single object by using mPosition from your list and pass it
//JSONObject item = peoples.getJSONObject(mPosition);
Log.d("OnImageButton", "Clicked");
Intent intnt =new Intent(mcontext, SingleViewActivity.class);
//intnt.putExtra("Contact_list", item);
mcontext.startActivity(intnt) ; //This line raises error
Toast.makeText(mcontext, "intent",
Toast.LENGTH_LONG).show();
}
});