Is it possible to start an Activity from a Service? If yes, how can we achieve this?
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.
android.app.Serviceis descendant ofandroid.app.Contextso you can usestartActivitydirectly. However since you start this outside any activity you need to setFLAG_ACTIVITY_NEW_TASKflag on the intent.For example:
where
thisis your service.