Android Thread Pool has runnables building up without execution after background state -
my application has thread pool creates 3 simultaneous threads. invoke runnables, added thread pool.
my problem happens when application goes background while. eventually, threads stop executing runnables in pool , pool continues grow. if bring application foreground, threads not start running again.
my theory when application goes background threads being killed. i'm not sure , i'm not sure of way of determining whether threads killed can start them again.
do have suggestions can determine whether or not thread has been killed?
you can't use thread pool execute code in background because android activity lifecycle won't consider app active, , kill process (including threads) after lose ui focus. want android service has different lifecycle. things use local service handler , handlerthread can post runnables into. you'll want similar.
note: every time feel there must easier way, might worth searching if has simplified pattern.
Comments
Post a Comment