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.
some are given below.
- Timer () ( for repeated task again and again)
- Thread and Handler (Both repeated and long running program)
- Service (most preferable for long and background task )
0 Comments