user1089640
user1089640

Reputation: 115

how to remove default view of tabbar in android

here i need to disply same tabbar in all activities.my tabbar conatain 4 tabs home,contact,callus,about.inside tabs again i have some buttons.here tabbar working fine.but when i run the app that time tabbar displyed in bottom at the same time inside firsttab(home) wich funs(like buttons what ever) is there that also displyed.but in my when i click the home tab that time only i need to disply home tab functionalities. so i dont know how to remove default veiw of tabbar. can u any one knows suggest me.

Upvotes: 1

Views: 408

Answers (1)

Shreyash Mahajan
Shreyash Mahajan

Reputation: 23606

See this example: Here it it

Edited:

Just replace the code:

    @Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
//preventing default implementation previous to android.os.Build.VERSION_CODES.ECLAIR
return true;
}
return super.onKeyDown(keyCode, event);
}

with the code:

  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (keyCode == KeyEvent.KEYCODE_BACK) {
          //preventing default implementation previous to android.os.Build.VERSION_CODES.ECLAIR
          finish();
          return true;
      }
      return super.onKeyDown(keyCode, event);
  }

After that back Button will work.

Hope it will help you. :)

Upvotes: 1

Related Questions