Android Question Http call, better dialogs and threads

rboeck

Well-Known Member
Licensed User
Longtime User
Hi

i am thinking about a solution for this problem:

i use a button to start google maps in navigation mode - as a feature, i want to show the user a dialog, where he can choose his origin adress, combine this with the destination adress and call google maps.
This works already.
Then i found the google distance matrix api: it would be nice, not only to show the origin destinations, better would be, to present the time and distance needed from each origin point.

So i made an http request, before i call better dialogs; my plan was, that the http response modifies my already showing better dialog.
As you can maybe imagine, the http _ Jobdone routine is only called, after i choose something from better dialog.
So i see more solutions:
* i make another dialog, which is not modal; this would also make sure, that i can change dialog details
* i try something with treats
Any ideas or solutions?
Greetings
Reinhard
 

thedesolatesoul

Expert
Licensed User
Longtime User
I suggest you use a dialog that is not modal.
Even if you use threads, this your display thread is modal and stuck, you cannot update anything on it.
This is one of the biggest issues with modality which is why I stopped using modal dialogs when other things need to be done concurrently.
 
Upvote 0

rboeck

Well-Known Member
Licensed User
Longtime User
I am ready; it was faster to realize, than expected. The answer time from google is from 0.3 sec to 1.5 sec.
Thanks for your response!

Reinhard
 
Upvote 0
Top