So i am using fragments and trying to wire on click listeners on them.
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bun
This line makes no sense:
startButton= (Button) getView().findViewById(R.id.button);
You don't have a View yet, you are still creating it..
In stead you can do this:
startButton= (Button)contentView.findViewById(R.id.button);
Or wait until the onCreateView method returns the actual View you just created and then you will be able to get a reference of the view using the "getView" method after onCreateView returns the view..
Hope it Helps!
Regards!