android - Is it safe to assume that a thread created from the main thread is running in the background? -
for app i'm developing, created thread main thread follows:
thread background = new thread(new runnable() { public void run() { log.d ("thread", "thread has started"); processimage(data, size.width, size.height, camera); camera.addcallbackbuffer(data); log.d ("thread", "thread has ended"); } }); if (!background.isalive){ background.start(); }
now, safe assume newly created thread running along main thread (in backgroud)?
yes, safe, after called start. can use isalive()
method check whether thread executing. why need such assumption, anyway?
Comments
Post a Comment