10-22-2009 06:34 PM
Hey. My app, in main(), adds a System Listener on cold boot (battery replaced), with no errors. However, the powerUp method below doesn't fire when I switch my BB off and on- press the red end button for 5 sec and then press again (a warm boot). How do you get powerUp to be called? Code is below.
MySystemListener msl = new MySystemListener();
MonthlySpend ms = new MonthlySpend();
ms.addSystemListener(msl);
private static class MySystemListener implements SystemListener
{
public void batteryStatusChange(int a) {}
public void batteryGood() {}
public void batteryLow() {}
public void powerOff() {}
public void powerUp() {
// PerformAnyReset... calls the Schedule, so if it does the reset, don't schedule twice
if (!PerformAnyResetWhichWasScheduledWhilePhoneWasSwi
ScheduleTotalResetForStartDateOfNextBillingCycle()
SetIconAndTitle();
ScheduleIconUpdateOvernight();
String logMessage = "Warm booted";
if (EventLogger.logEvent(0x4c9d3452d87922f2L, logMessage.getBytes(), EventLogger.ALWAYS_LOG)) {
System.out.println("Log Successful!");
}
Solved! Go to Solution.
10-27-2009 06:54 AM
Hey- fixed. The app itself has to be a SystemListener, not another class
J
10-27-2009 07:57 AM - last edited on 10-27-2009 07:58 AM
Not 100% sure that is true, though in my case, that is how I code it so I've not tried anything else. Anyway, can you mark this as Solved please.