How to start an activity by click of image button of a List view?
i have a list there is a image button in each item when i click on a image i have to start another Activity with intent following are my code my problem is i couldn't call startActivity() from custom adapter! ! in custom adapter's getView() holder.profilePicture.setOnClickListener(new OnClickListener() { public void onClick(View v) { Log.d("OnImageButton","Clicked"); Intent zoom=new Intent(AllProfile.getAppContext(), ImageZoom.class); int imageID=holder.profilePicture.getId(); zoom.putExtra("ImageId", imageID); startActivity(zoom) ; //This line raises error ! } }); You should pass your context