posted 12 years ago
Hi guys,
I'm new to the android platform and am reading the book Android application development for dummies, sorry if this is a silly question!
My problem:
From my understanding (refering to the code below), when the app widget updates itself,
1. the onUpdate() method is called
2. an explicit intent starts a toggleService
3. onHandleIntent() method in toggleService is called
4. Line 47-53 executes, causing the phone to be turned to normal mode if it was in silent mode and vice versa if the opposite was true.
So i changed the updatePeriodMillis value to 100 but the phones ringing mode wasn't changing every minute.
I know this is the desired outcome but would like to understand why the ringing mode doesn't change every minute.
After reading up on the Android developers website I was wondering if the update intent and any incoming intents must pass through the onReceive() method first.
Then, since the intents that should trigger the toggle service should have no action data, line 19 would be executed only for such intents.
Does this meant that update intents have action data? And if line 21 is executed, will onUpdate() run after that?
(public abstract void onReceive (Context context, Intent intent)
Since: API Level 1
This method is called when the BroadcastReceiver is receiving an Intent broadcast. During this time you can use the other methods on BroadcastReceiver to view/modify the current result values.)
Thanks in advance to anyone patient enough to help with this noobish problem x).