Reputation: 19102
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)?
Upvotes: 0
Views: 686
Reputation: 1897
because there is no such function in this class OnClickListener. Try calling it from context, or if it will not work from applicationContext
Upvotes: 1