How to wait the opening of ListPicker until my one of my processes is completed on touching the LIst Picker Button

In my app, I wanted to add the elements in my List Picker from the MySql database.
So, I did it something like this:-
When the user clicks the ListPicker on the screen, I fetch data from my database and then add elements to the ListPicker, but it takes a couple of seconds so the ListPicker opens with no elements.
So, what I wanted to do is wait for the ListPicker to get data from Database and then once it is fetched then open the ListPicker with elements.

Use some progress notifier till data download from SQL, once download make it to dismiss

But, the List Picker doesn’t wait to open until the data is fetched.
It opens instantly once the ListPicker button is clicked,so how to prevent it.

Show your list picker blocks

Here, in the first block, I call to fetch data.
And, in the second block the data should be made the elements of the ListPicker.

But, what happens is before the data is fetched from the database the ListPicker Menu opens with no elements.
image

In the got all columns use if else statement.

If get value is not equal to empty text box
Then,

  1. Dismiss progres dialogue
  2. And add your remaining blocks next , one by one

Simple

So till it get value progress dialogue won’t disappear

Oh, the list picker doesn’t wait for the data to be fetched it opens instantly with the touch on the ListPicker Button. So before the data is fetched it pops up.

Why don’t you download SQL data to list picker elements when screen initialise?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.