I'd like to know if it's possible to send a local notification to the device when the app have been opened then closed.
It works already when my app is opened and when it's in the background.
Thanks
Edit : I think i wasn't clear enough:
I want to send a local notification at a given time even if the app is not running at that time.
By "Local Notification" i mean a Notification (android class) created in my app and send by using an AlarmManager and a BroadcastReceiver.
closed -> killed the process of my app
Most means of "killed the process of [your] app" will leave your alarms intact, and so whatever you have scheduled will remain scheduled and keep being invoked as you set up.
I want to send a local notification at a given time even if the app is not running at that time.
Again, AlarmManager
is not dependent upon your process being around, so long as it can invoke the PendingIntent
that you supply. So long as the BroadcastReceiver
you are using is registered in the manifest (and not via registerReceiver()
), it should work fine.
If the user force-stops your app -- usually via the Settings app -- then not only will your alarms not be invoked, but your code will never run again, until something explicitly starts up your app (usually the user tapping on your icon in the launcher). There is nothing that you can do about this.
it's hard to explain things when you do understand fully and when english is not your native language
There are many Android developer support sites, offering a variety of languages.
you need to create a service, http://developer.android.com/guide/components/services.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With