I am developing an activity which have an Update button as menu for android. I want to show a dialog. I done it via
showDialog()
Update operations are controlled by a function named update_rates()
update include downloading file from internet and updating database values
But when i click the menu button it stucks the it download the file and update database.
if I comment the update_rates function it shows dialog but with update_rates it doesn’t show dialog
How can i solve this problem?
https://github.com/sreevisakh/android/blob/master/src/com/sv/cc/main.java
Does it never show the dialog? Or does it only show the dialog once it’s done it’s processing?
To me, it sounds like your update_rates() method is either:
If either case is true, then you may want to investigate using AsyncTask to do the work; as this operates in a separate thread, but is also able to perform UI actions.
This article has some more information: http://developer.android.com/resources/articles/painless-threading.html