0

I am new with android development. I am using TABLayout and I am having a problem getting information from the JSON data set inside a fragment.

Inside the fragment, I implement an AsyncTask that is evoked inside the fragment’s method onCreate.

In doInBackground I save the JSON data in an object (eventsDetail) that is public for the fragment class.

Inside of onCreateView I use eventsDetail to populate various string widgets. Also, I populate longitude and latitude data to a map (SupportMapFragment).

When I first enter at onCreateView I have no issues. Then I leave the fragment. When I go back into the fragment again, I receive the error (java.lang.NullPointerException) on the eventsDetail object.

Has anyone encountered this problem? I think the problem is that I am accessing the JSON incorrectly.

0 Answers0