Tuesday 19 April 2016

Thread in android

Thread is concurrent unit of execution. It has its own call back stack for method being invoke, there argument and local variables. Each application having at least one thread is running when application started.the run times keeps its own thread in the system thread group.

There are two way to execute code in a new thread. you can either create sub class of Thread and override run() its own method or construct new thread and pass runnable to constructor  in either case start() method must be called to actually execute new thread .

Each thread has an integer priority that affect how the thread is scheduled by the OS. A new thread  inherit the priority of its parent,
.
for more details click here

No comments:

Post a Comment