Java 使用嵌套TabHost时无法键入EditText
我试图在编辑文本中输入文本,但得到显示关键事件(如KeyUp)的Logcat信息Java 使用嵌套TabHost时无法键入EditText,java,android,Java,Android,我试图在编辑文本中输入文本,但得到显示关键事件(如KeyUp)的Logcat信息 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); View viewToLoad = LayoutInflater.from(this.getParent()).inflate(R.layout.datacard_activity, null); this.setCon
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View viewToLoad = LayoutInflater.from(this.getParent()).inflate(R.layout.datacard_activity, null);
this.setContentView(viewToLoad);
从其他活动加载此活动
// Datacard Tab
Bundle b3=new Bundle();
b3.putSerializable("objCommonBean",objCommonBean);
Intent intent3 = new Intent().setClass(RechargeNowActivity.this, DatacardActivity.class);
intent3.putExtras(b3);
transactionDatespec = tabHost.newTabSpec("").setIndicator("Data Card",null)
.setContent(intent3);
tabHost.addTab(transactionDatespec);
tabHost.addTab(transactionDatespec)
final int height=45;
对于(i=0;i
final int height = 45;
for(i=0;i<tabHost.getTabWidget().getChildCount();i++)
{
TextView tv = (TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title); //Unselected Tabs
tv.setTextColor(Color.parseColor("#ffffff"));
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = height;
}
getTabHost().getTabWidget().getChildAt(0).setBackgroundColor(Color.BLACK);
getTabHost().getTabWidget().getChildAt(1).setBackgroundColor(Color.TRANSPARENT);
getTabHost().getTabWidget().getChildAt(2).setBackgroundColor(Color.TRANSPARENT);
tabHost.setCurrentTab(0);
tabHost.setOnTabChangedListener(new OnTabChangeListener(){
@Override
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
for(int i=0;i<tabHost.getTabWidget().getChildCount();i++)
{
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.TRANSPARENT); //unselected
}
tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.BLACK); // selected
}
});