I am having an issue binding my JSON data Object to a listView fragment. I\'m getting an NPE at line 100 where I bind to my Simple Adapter. I have tried various ways about doing
Unless you are omitting code you never assign the value of c
or context
.
When calling
SimpleAdapter adapter = new SimpleAdapter(c, mList, R.layout.list_item, from, to);
You are passing in "c" which will always be null.
switch "c" to getActivity()
and the problem should go away
Additionaly,
final AQuery aq = new AQuery(c);
You should initialize this once you know you have access to getActivity(). When a fragment is created it will not immediately have access to the activity until attach(..) is called.