I have a class, DFragment. I'm passing a List<Map<String, String>> to its constructor, and I need to store the passed-in value in the member variable subVitalList.
I tried doing this:
this.subVitalList = subVitalList;
But I receive the following error on that line:
com.example.DFragment.this cannot be referenced from a static context
I'm not sure how to do this. Here is the code for DFragment:
public class DFragment extends DialogFragment {
Context context;
List<Map<String, String>> subVitalList;
ListView vitalEntryListView;
LayoutInflater mInflater;
public static DFragment newInstance(List<Map<String, String>> subVitalList,int i) {
DFragment f = new DFragment();
// Supply num input as an argument.
Bundle args = new Bundle();
//args.putInt("num", num);
args.putInt("num",i);
//List<List<String>> svl = getArguments().getStringArrayList(subVitalList);
return f;
}
}
What am I doing wrong and how do I correctly store the passed-in value in my member variable?