Android Emulator Crash If Click While Processing
Solution 1:
Ok the chances are you might be causing the UI thread to hang due to this heavy processing -but I could be way off without seeing any code -hint-. What you might is put the heavy stuff into a background thread seperate to the GUI thread, which you are currently running in.
Luckily Android has the AsyncTask class to help you here. Lets say (as there is not enough detail in the question) you are logging in to your app by making a web request to a server. When the user presses login you want to show some sort of processing message while doing all the legwork in your background thread.
Take a look at this article in particular the AsyncTask example http://www.vogella.de/articles/AndroidPerformance/article.html
You can see that doInBackground() is where all the heavy lifting is done and that postExecute() runs in the UI thread once again, which is where you will want to update the UI based on the result of what just happened. For example the user logged in sucessfully or an error occured while logging in.
I could go on for quite some time however this is well documented. Another good post by Google themselves can be found here http://android-developers.blogspot.com/2009/05/painless-threading.html
Post a Comment for "Android Emulator Crash If Click While Processing"