android - BroadcastReceiver firing for only one action -


so in following situation: want schedule alarm repeat after x interval. alarm should scheduled while user has logged app not logged out.

the expected behavior be: schedule alarm when device boots (if user hasn't logged out). or, schedule alarm when user logs in. assures if user restarts device, alarm still fire.

i went implementing using custom receiver have declared in manifest so:

<receiver     android:name=".notifications.alarmbootreceiver"     android:enabled="false">     <intent-filter>         <action android:name="android.intent.action.boot_completed"/>     </intent-filter>     <intent-filter>         <action android:name="com.example.start_alarms"/>     </intent-filter> </receiver> 

this works alarm scheduled after device boots up.

the problem: when attempt trigger receiver so:

intent newintent = new intent("com.example.start_alarms"); sendbroadcast(newintent); 

absolutely nothing happens!

the receiver works, that's sure or else alarms wouldn't fire on boot. making sure receiver enabled via:

 componentname receiver = new componentname(this, alarmbootreceiver.class);  packagemanager pm = this.getpackagemanager();   pm.setcomponentenabledsetting(receiver,             packagemanager.component_enabled_state_enabled,             packagemanager.dont_kill_app); 

i can't figure out i'm missing, appreciated.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -