Thread in Android

By default every android application is separate thread which called main thread. If any one want to run any work which take more than ten second and run at in the main thread . then your application must to terminated unexpectedly . To avoid this problem you must create second thread and do the long running process in this separate thread. when process in come to end then its result are now passed to main thread for user.Then your Application will be run smoothly. Android used different type of threads
some are given below.
  1. Timer () ( for repeated task again and again)
  2. Thread and Handler (Both repeated and long running program)
  3. Service  (most preferable for long and background task )

Post a Comment

0 Comments