I call a Service in Activity, but when i close the application, the services are closed. How I create a infinite life cycle service? And, how I call a Activity in the BroadcastReceiver?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t. The OS will terminate your process when it sees fit, which includes terminating it when the user asks, such as via a task killer application. Please design your application with this in mind.
If the
BroadcastReceiverwas registered by the activity, viaregisterReceiver(), then if theBroadcastReceiveris an inner class of the activity, it can just call methods on the activity normally, just like any inner class in Java.