I've been trying to check what the user might do and I catched a NullPointerException in my service , when the user sets a notification so my service can notify the user when the time comes and then the user shuts the app from the recent apps , it crashes , I did handle the error by try and catch , but the problem is how can I get the information that was passed by intent to the service ? and most importantly how to solve this problem ?
this is the error:
08-04 13:28:04.863: E/AndroidRuntime(3380): java.lang.RuntimeException: Unable to start service
com.example.myapp.Service_reminder@b4ef5228 with null: java.lang.NullPointerException
I've searched and found:
Android service crashes after app is swiped out of the recent apps list
when I've gone to the android guide about the foreground service it says that one of the functions is deprecated.