F
F
frisk2014-06-06 20:50:23
Java
frisk, 2014-06-06 20:50:23

Expandablelistview inside Fragment?

Hello, there were difficulties with the implementation of the Expandable ListView in Android from this article
www.androidhive.info/2013/07/android-expandable-li...
Task: to implement this element inside the Fragment or ListFragment heir.
Problem: when replacing fields (this) and others that require context with getActivity().getApplicationContext() , the application crashes when accessing the fragment.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bimeg, 2014-06-06
@bimeg

it is sufficient (and important) to replace with getActivity()

O
one pavel, 2014-06-06
@onepavel

You only need to replace this on getApplicationContext in one place, when creating the ListView adapter. The rest can be removed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question