Answer the question
In order to leave comments, you need to log in
How to pass context to adapter inside fragment?
I'm trying to put json in the listview, there are plenty of examples, but I do it all in a fragment and not in an activity... I've had a
lot of problems when creating an adapter:
MySimpleAdapter sAdapter = new MySimpleAdapter(this, data, R.layout.item, from, to );
listView.setAdapter(new ArrayAdapter(this, R.layout.page_search, items));
ArrayAdapter simpleAdapter = new SimpleAdapter(this, listView, android.R.layout.simple_list_item_1)
Everything leads to one thing - SimpleAdapter cannot be applied
as I understood the error when passing the context, Google advised getActivity (), but the elements are in the current fragment...
ZY Probably the question is stupid, but I've been struggling for 3 hours trying to put the data in the listview
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question