android - Silent crash occures in the thread. NotificationManager, timer and threads "magic". Non-trivial problem, as it seems -
android - Silent crash occures in the thread. NotificationManager, timer and threads "magic". Non-trivial problem, as it seems -
i've stucked next funny problem:
private object lock=new object(); public void letssaymain(){ timer=new timer(); task=new requestmessages(); timer.schedule(task, first_delay, period*60*1000); //period = 10, first_delay=10*1000 } private class requestmessages extends timertask{ public void run() { synchronized(lock){ foo(); log.d(applicationconstants.application_class_name, "yay, we've exited method!"); } } private void foo(){ . . //notification initialization . . log.d(applicationconstants.application_class_name, "we've show notification."); mnotificationmanager.notify(z, notificationtransactions); //z unique int, starting 1. notificationtransaction - forged notification. log.d(applicationconstants.application_class_name, "we've shoved notification."); } };
the output is:
07-09 05:23:50.864: debug/allapp(6919): we've show notification.
and that's all.
can tell me, problem is, , why execution of thread code finishes, after phone call mnotificationmanager.notify() ??? way, timer still running, , after 10 minutes - execute code again. timer runs code in it's own thread. dunno tell, if timer thread terminates , relaunches 1 time again in no time, seems, thread intact, executes top-level stack function (which count timer again).
android shows notification well.
i have notify() embedded cycle, it's critical me - go on execution, after phone call mnotificationmanager.notify().
edit1: seems silent crash:
pathclassloader(classloader).loadclass(string) line: 532 inotificationmanager$stub$proxy.enqueuenotification(string, int, notification, int[]) line: 157 notificationmanager.notify(int, notification) line: 94 . . .
and next step single line:
timer$timerimpl.run() line: 294
before crash, pathclassloader(classloader).loadclass(string, boolean) line: 563 executed 2 times repeatedly, 1 line of pathclassloader(classloader).loadclass(string) line: 532. @ sec exit - get's loadclass(string), , next moment - blows away.
any suggestions - should create now?? i've never faced silent crashes before...
android multithreading timer notifications notificationmanager
Comments
Post a Comment