B BrutalSnyper Member Licensed User Longtime User Apr 26, 2013 #1 EDIT: Solved the problem. I simply hadn't used quotation marks inside the initialization. Hi there, I'm trying to run a few statements on the BatteryChanged event of PhoneEvents yet it isn't working. I receive no errors and nothing in the log. The event doesn't seem to be called at all, I initialize the PhoneEvents in Activity_Create. Code: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("MainLayout") thePhoneEvents.Initialize(thePhoneEvents) End Sub Then I have this code in the event which never seems to be called. Code: Sub thePhoneEvents_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent) lblChargeLevel.Text = "The current level of charge is: " + Level + "%" pbChargeLevel.Progress = Level Log("The battery level is: " + Level) End Sub Thanks in advance! Last edited: Apr 26, 2013
EDIT: Solved the problem. I simply hadn't used quotation marks inside the initialization. Hi there, I'm trying to run a few statements on the BatteryChanged event of PhoneEvents yet it isn't working. I receive no errors and nothing in the log. The event doesn't seem to be called at all, I initialize the PhoneEvents in Activity_Create. Code: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("MainLayout") thePhoneEvents.Initialize(thePhoneEvents) End Sub Then I have this code in the event which never seems to be called. Code: Sub thePhoneEvents_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent) lblChargeLevel.Text = "The current level of charge is: " + Level + "%" pbChargeLevel.Progress = Level Log("The battery level is: " + Level) End Sub Thanks in advance!
NJDude Expert Licensed User Longtime User Apr 26, 2013 #2 That's because this line should be like this: Code: thePhoneEvents.Initialize("thePhoneEvents") Upvote 0