android: Running a time consuming task in UI Thread?
in my app i am trying to process a task in the UI Thread when a button is clicked (the task is executed only once when the button is clicked)... since the task is time consuming my UI gets frozen and doesn't allow the user for further input...
my question is that is there any other method apart from "Thread"s to run my task so that my UI doesn't get frozen ..sinc开发者_开发知识库e i don't want the task to run repeatedly..
if possible can u provide me with sample code or links....
thanks :)
AsyncTask is a very convenient way for that, it has great hooks for initialization and clean-up.
Docs including example here.
精彩评论