Click here to Skip to main content
15,891,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am develop android app which i need to download data(products details,images) from my server using httpclient the problem is i need to wait until all data has finished download. i need to show data which has been downloaded in recylerview while other are continue downloading. Thanks in Advance

What I have tried:

C#
var responseBooked = await client.GetAsync("url");
        //will always throw an exception if not successful
        responseBooked.EnsureSuccessStatusCode();
        if (responseBooked.Content != null)
        {
        var responseContent = await responseBooked.Content.ReadAsStringAsync();
        mBcomplist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<busCompList>> 
                      (responseContent);
        //Create our layout manager<pre lang="c#">


SimpleItemDecorator itemDecor = new SimpleItemDecorator(Context);
mRecyclerView.AddItemDecoration(itemDecor);

mLayoutManager = new LinearLayoutManager(Context);
mRecyclerView.SetLayoutManager(mLayoutManager);

recycleViewAdapter = new CompAdapter(mBcomplist,"Bus");
mRecyclerView.SetAdapter(recycleViewAdapter);
Posted
Comments
David Crow 10-Sep-18 10:55am    
"...i need to wait until all data has finished download. i need to show data which has been downloaded..."

So which is it, do you need to wait until all data has been downloaded (to show anything), or do you want to show what has been downloaded so far?
Member 12234802 11-Sep-18 4:37am    
to show what has been downloaded

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900