There's an ListView in a fragment, I want it to show some messages downloaded from the server(json arrays) every time the fragment is created. After downloading I put the messages into a sqlite database, and then reveal the messages in that listView, using BaseAdapter.
But I have to know what getCount() in BaseAdapter should return before setAdapter(); but downloading messages needs time, I won't know the count until the messages are downloaded.
So I put an progress bar in the fragment and try to start another fragment and setAdapter() after the messages are downloaded and written into the database. The Question is how can I know when the messages are downloaded and written to the database?
Aucun commentaire:
Enregistrer un commentaire