`
ithinkfeed
  • 浏览: 91879 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

TabSpec activity is unable to bind to a service

阅读更多

To reproduce:

1) Create class that extends TabActivity
2) on the tabHost add a tab which has content set to an activity which
binds to a service via IPC

The activity binds fine normally but not when used as tab content.

DDMS reports (in my case): 
ActivityManager::Binding with unknown activity: android.os.BinderProxy@436dd168

Log messages in the service verifies that the onBind method is never called.
Using getApplicationContext().bindService instead of just bindService on your
activity solves the problem as it is using the higher level application context.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics