Is it ok to use bindService more than once with the same context to the same service ?
Can I use bindService multiple times with the same context to the same service and unBindService only once ?
Thanks
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.
It is possible to bind multiply times to the same service with the same context, but it is looks to me as bad practice. Also, you cannot unbind from service only once. You must unbind all your
ServiceConnection‘s .UPDATE: As for why it looks to me as a bad practice, it is because I can’t imagine why one’s will need that. Also I think connection wrapper which will bind and unbind only once and serve as facade interface to service could be better, because it’ll introduce less overhead and less error prone (in my opinion though)