12-28-2013 10:39 PM
one of the features of my app is being able to set a notification in the Hub.
I have been wrestling with a bug in my app where CPU spikes, basically consuming 50% of system resources until it's killed.
I've been trying to isolate the cause, and i *think* i have finally found it.
Occasionally, when i call ->notify(), I get a return code of 1 (which is "Unknown" according to https://developer.blackberry.com/native/reference/
the code that generates the Notification is very basic. here:
Notification * pNotification = new Notification(); bb::platform::NotificationError::Type ret; pNotification->setTitle("ALERT: "); pNotification->setBody(notifBody); // pNotification->setIconUrl(); // NOTE: when you upgrade to 10.2 ret = pNotification->notify(); qWarning() << QDateTime::currentDateTime() << " : " << "return code for notify() was: " << ret; ret = pNotification->clearEffects(); qWarning() << QDateTime::currentDateTime() << " : " << "return code for clearEffects() was: " << ret; delete pNotification; // pNotification->deleteLater(); // couldn't seem to get it to work with this
So, in cases where the CPU spikes, the return code for notify() was 1.
Does anyone know what could cause this? Or even better, a way to recover from it? Once this happens, the only thing I seem to be able to do is stop the app.
any insight appreciated!
12-29-2013 01:19 AM