I have implement Nested Fragments. Child fragment contains BaseAdapter. When I switching(replace) child fragments then I am getting Nullpointer exception. Code:
public MyAdapter(final Context context,
final List<CusomObject> CusomObjectList) {
mInflater = LayoutInflater.from(context);
this.CusomObjectList = CusomObjectList;
}
I am getting error in this line - mInflater = LayoutInflater.from(context);
I passed getActivity()
in MyAdapter
constructor from Fragment.
Code:
adapter = new MyAdapter(getActivity(), customList);
listView.setAdapter(adapter);