I have an Activity
, and three tab each with it's own Fragment
s. I am loading video information from JSON into a list in Activity
.
I read URL of video from list and display it in upper half of Activity
layout, I have three Fragment
s in bottom half, the first Fragment
shows info about video, second, related video, and third comments.
Problem is: I want to send the list from Activity
to 3 Fragments
in tabs.
I did lots of ways, using interfaces, callback,... but before fetching JSON data from url, Fragments
starts and when this happens the empty list want to be set to TextView
s, EditText
s, ImageView
s,... in Fragment
and then application stops.
How to get data from JSON and then load Fragments
? Or
How to simultaneously load data to Activity
itself and all Fragments
? Or
I can fetch that JSON in activity and 3 Fragments
separately, but I don't want to do that!
Please give me a tutorial or an article to learn this subject.