If your newTask method is designed to be called by an onClick handler from a layout then you can add a tag to the view and then call view.getTag() inside your method.
That is one way that you could have many views call the same onclick handler method but then do different things.
2
solved ANDROID: How to call a method with arguments? [closed]