I have got a question regarding the usage of context in a fragment. My problem is that I always get a NullpointerException. Here is what i do:
Create a class that ex
When are you instantiating your Helper class? Make sure it's after onActivityCreated() in the lifecycle of the Fragment.
http://developer.android.com/images/fragment_lifecycle.png
The following code should work:
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
helper = new Helper(getActivity());
}