I want to use my database adapter in my list fragment to get all entities from a table to put into the listview, but when I try to construct it during the fragment creation I get the message that context can't be applied to my fragment.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DbAdapter db = new DbAdapter(this); //error message here
}
However, I don't get an error message when I put the adapter in my activity.
How can I get the activity that my fragment is in so I can use it as the context? Or alternatively, is there a better way to do this?