I would assume that line 55 is iv_delete.setOnClickListener(...)
. If task_delete_image
is a View inside the ListView's item view, then you cannot use findViewById()
here, as the ListView items haven't been created yet.
Your best alternative would be to modify your custom adapter (TaskAdapter), and set the OnClickListener
in the getView()
method for each item. See for example this answer.
On a totally unrelated subject, finishing the activity and creating a new one just to refresh doesn't seem like a good idea.
On another totally unrelated subject ;) as the commenters to the question said, the ActionBarActivity member doesn't make a lot of sense. Activity classes should never be directly instantiated, the framework will do that with calls to startActivity().