Advertisement
Guest User

Untitled

a guest
Mar 7th, 2012
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. for(int t = 0; t < tabHost.getTabWidget().getChildCount(); t++){
  2.     View child = tabHost.getTabWidget().getChildAt(t);
  3.     String tag = (String) child.getTag();
  4.  
  5.     if(tag != null) {
  6.         if(tag.equals("TAB1")) {
  7.                 child.setOnClickListener(new OnClickListener() {
  8.                 tabHost.setCurrentTab(0);  
  9.             }
  10.         });
  11.     } else if(tag.equals("TAB2")) {
  12.                 child.setOnClickListener(new OnClickListener() {   
  13.                 tabHost.setCurrentTab(1);
  14.             }
  15.         });
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement