Any help will be highly appreciated. I am using a ImageButton in each row of a ListView. When user presses the Button, I need to fire another activity. I have written the code
viewHolder.editWordButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(view.getContext(), EditTextClass.class);
startActivity(i);
}
});
But it does not identify function startActivity(i)?
You do realize that startActivity(..) is not a method of an OnClickListener? Where does startActivity(…) come from? Why it comes from Context. So knowing this, how can you start the activity, what do you need? CONTEXT.