0
叫我使用绑定到我的所有activities
本地Service
,当我开始一个Activity
我得到一个callback
:绑定的服务onServiceConnected回调不TabHost
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
}
,但如果我用一个TabHost并且如果活动正在以下一个方式开始:
TabSpec spec = tabHost.newTabSpec("Spec");
intent = new Intent(this, TestActivity.class);
spec.setContent(intent);
onServiceConnected回调被neved调用。
为什么?如何解决这种情况?
SUMMARY:
intent = new Intent(this, MyActivity.class);
startActivity(intent); // In this case callback is called
TabSpec spec = tabHost.newTabSpec("Spec");
intent = new Intent(this, MyActivity.class);
spec.setContent(intent); // In this case callback is not called
发布一些更多的代码,这是不够的解决方案 – stackoverflow 2013-04-24 10:44:53