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.
分享到:
相关推荐
Tabwidget的不同tab指向不同的Activity
TabHost组件可以在界面中存放多个选项卡, 很多软件都使用了改组件进行设计。 一、基础知识 ...TabHost的基本使用,主要是layout的声明要使用特定的id号,然后activity继承TabActivity即可。 main.xml: <T
Fragment切换demo采用自定义FragmentTabHost,继承了TabHost使用方法在activity中写下 FragmentTabHost mFragmentTabHost = (FragmentTabHost) findViewById(R.id.tabhost); mFragmentTabHost.setup(this, ...
/*添加第一个选项卡*/ TabHost.TabSpec tab1 = tabHost.newTabSpec("tab1"); tab1.setIndicator("login"); tab1.setContent(new Intent(this,LoginActivity.class)); tabHost.addTab(tab1); /*添加第二个选项卡*/ ...
An example of tab content that launches an activity via {@link android.widget.TabHost.TabSpec#setContent(android.content.Intent)}.
这个例子中涉及到ListView、各个界面UI控件的使用、TabHost、跑马灯字符串...TabSpec、为按钮添加监听、图片上传界面、向服务器发送消息、向服务器发送数组的长度、向服务器发送图片字节数组、动态生成每个下拉项对应的...
TabHost使用以及源码分析。 对应的文章为:http://blog.csdn.net/yanbin1079415046/article/details/7973022
TabHost.TabSpec localTabSpec = tabHost.newTabSpec(str).setIndicator(localView).setContent(intent); tabHost.addTab(localTabSpec); } @Override public void onTabChanged(String tabId) { //...