I am filling a table on tabhost after login. I have set up a thread to fill in the table. Meanwhile I click on the tab where I have set up another thread to read the data from the same table and fill the adapter for the list view.
My problem is that the thread which fills the table on tabhost takes some time and meanwhile if I click on the tab to show the data from table it shows no data found because of the adapter being empty.
How to solve this? Is it something like producer/consumer which can be solved using wait()
and notify()
?