0

Although all the sendXXXXX booleans are true the code stops executing at the first notify(). If I manually set the first one to false, then the code stops executing inside the second if statement.

When .notify() is called acts like a return statement. It exits the function but doesn't throw any errors/exceptions.

if (sendAC) {
    mNotificationManager.notify(XMPP_ID, notificationHouse);
}
if (sendRefridgerator) {
    mNotificationManager.notify(XMPP_IDRefridgerator, notificationRefridgerator);
}
if (sendWater) {
    mNotificationManager.notify(XMPP_IDWater, notificationWater);
}
mrngneom
  • 31
  • 3
  • What do you mean that it "stops executing"? Does it block, throw an exception, or something else? – Ted Hopp Jun 05 '12 at 18:49
  • The debugger just stops there (doesn't continue to next if statement). I don't get any errors in Logcat. – mrngneom Jun 05 '12 at 19:01
  • Okay, hours later figured it out. It was a silent exception (it didn't show up in Logcat). So I added a try catch around it to figure out what the error was. I just didn't have vibrate permissions in the manifest so I was getting a SecurityException, but it wasn't showing without the catch. – mrngneom Jun 05 '12 at 23:36

2 Answers2

1

Okay, hours later figured it out. It was a silent exception (it didn't show up in Logcat). I went through the thread step by step in the debugger and it showed a security exception. So I added a try catch around it to figure out what the error was. I just didn't have vibrate permissions in the manifest so I was getting a SecurityException, but it wasn't showing without the catch.

mrngneom
  • 31
  • 3
0

Clean your project, then reinstall it. I'm guessing the reason the debugger doesn't go to the next if statement is because the following code isn't loaded onto the device.

Either that, or you messed up your if statements' braces somewhere

you786
  • 3,659
  • 5
  • 48
  • 74