Android: TabHost is stealing focus from a EditText

I am recently working on Android app development and had an issue with TabHost and EditText inside that TabHost. 

somehow, when I was trying to insert a value in that EditText, focus was set automatically on tab and was not able to type anything. 

Tried hard to google and came to know that its a bug and Good team is working on it as of today. But there is a workaround for this problem as below – 


txtDescription = (EditText) V.findViewById(;
txtDescription.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View view, MotionEvent motionEvent) {
return false;

10 thoughts on “Android: TabHost is stealing focus from a EditText

  1. Or you can remove OnTouchModeChangeListener of the Tabhost:
    TabHost mTabHost = (TabHost) findViewById(;
    mTabHost.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {

    public void onViewDetachedFromWindow(View v) {}

    public void onViewAttachedToWindow(View v) {



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s