开发者

android activity cannot bind to service

开发者 https://www.devze.com 2023-01-19 01:45 出处:网络
I managed to connect an activity to a service and it runs ok. This is my first activity in the application. However, if i progress (with or without binding to the service in the first activity), the n

I managed to connect an activity to a service and it runs ok. This is my first activity in the application. However, if i progress (with or without binding to the service in the first activity), the next activity (resides in a tab) will not bind to the service.

note that if i make the trouble-making activity to be my first in the app, it works fine.

any hints on what might cause the pb? the code in the 2 activities is the same. might it be because of the tabbing? do i need to setup any particular i开发者_StackOverflow中文版ntent filtering stuff>? (i only have the default intent filtering that comes with the template)

Thanks. Alex


apparently this is a known issue:

http://code.google.com/p/android/issues/detail?id=2665


As a workaround, you can use getApplicationContext().{bindService,unbindService}

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号