Note that there are some explanatory texts on larger screens.

plurals
  1. POSilent crash occures in the thread. NotificationManager, timer and threads "magic". Non-trivial problem, as it seems
    primarykey
    data
    text
    <p>I've stucked into the following funny problem:</p> <pre><code>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 just exited the method!"); } } private void foo(){ . . //Notification initialization . . Log.d(ApplicationConstants.APPLICATION_CLASS_NAME, "We've about to show the notification."); mNotificationManager.notify(z, notificationTransactions); //z is unique int, starting from 1. notificationTransaction - forged notification. Log.d(ApplicationConstants.APPLICATION_CLASS_NAME, "We've shoved the notification."); } }; </code></pre> <p>The output is:</p> <pre><code>07-09 05:23:50.864: DEBUG/AllApp(6919): We've about to show the notification. </code></pre> <p>And that's all.</p> <p>Can someone tell me, what the problem is, and why the execution of the thread code finishes, after call to mNotificationManager.notify() ??? <BR> By the way, the timer is still running, and after another 10 minutes - it will execute that code again. The timer runs the code in it's own thread. I dunno to tell, if the timer thread terminates and then relaunches again in no time, but it seems, that the thread is intact, but executes only top-level stack function (which is just count the timer again).</p> <p>Android shows notification as well.</p> <p>I have that notify() embedded into the for cycle, so it's critical to me - to continue it execution, after the call to mNotificationManager.notify().</p> <p>EDIT1: It really seems like a silent crash:</p> <pre><code>PathClassLoader(ClassLoader).loadClass(String) line: 532 INotificationManager$Stub$Proxy.enqueueNotification(String, int, Notification, int[]) line: 157 NotificationManager.notify(int, Notification) line: 94 . . . </code></pre> <p>And the next step is single line:</p> <pre><code>Timer$TimerImpl.run() line: 294 </code></pre> <p>Before the crash, the <BR><BR> PathClassLoader(ClassLoader).loadClass(String, boolean) line: 563 <BR><BR> executed for the two times repeatedly, but just from the one line of PathClassLoader(ClassLoader).loadClass(String) line: 532. At the second exit - it get's back to loadClass(String), and next moment - it all blows away.</p> <p>Any suggestions - what I should make now?? I've never faced silent crashes before...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload