Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

I am getting warning from main thread.

$
0
0

I have many apis calls in a single page. The approach i am currently using is start a await Task.Run(() thread, do fetch operation, start Main Thread and do UI operations. The app works smooth but after few navigation, it stops responding. With some research it found thus can be due to main thread. Is this the correct way implementation, that i am using?

 await Task.Run(() =>
                {
fetchdata();
fetchData2();
fetchData3();

MainThread.BeginInvokeOnMainThread(() =>
                    {

//UI changes
}:

});

Viewing all articles
Browse latest Browse all 91519

Trending Articles