Java Code Examples for android.widget.TabHost

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project android-client_2, under directory /src/org/mifos/androidclient/main/.

Source file: AccountDetailsActivity.java

  22 
vote

@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putSerializable(AbstractAccountDetails.BUNDLE_KEY,mDetails);
  outState.putSerializable(Fee.BUNDLE_KEY,(Serializable)mApplicableFees);
  TabHost tabs=(TabHost)findViewById(R.id.accountDetails_tabHost);
  if (tabs != null) {
    outState.putSerializable(SELECTED_TAB_BUNDLE_KEY,tabs.getCurrentTab());
  }
}
 

Example 2

From project android-joedayz, under directory /Proyectos/GreenDroid/src/greendroid/app/.

Source file: GDTabActivity.java

  22 
vote

/** 
 * Add a new tab to this GDTabActivity
 * @param tag The tag associated this the new tab
 * @param label The label of the new tab
 * @param intent The Intent used to start the content of the tab
 */
public void addTab(String tag,CharSequence label,Intent intent){
  final TabHost host=getTabHost();
  View indicator=createTabIndicator(tag,label,getTabWidget());
  if (indicator == null) {
    final TextView textIndicator=(TextView)getLayoutInflater().inflate(R.layout.gd_tab_indicator,getTabWidget(),false);
    textIndicator.setText(label);
    indicator=textIndicator;
  }
  host.addTab(host.newTabSpec(tag).setIndicator(indicator).setContent(intent));
}
 

Example 3

From project Android_1, under directory /MultpileActivityTabHost/src/com/novoda/.

Source file: Container.java

  22 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  TabHost host=getTabHost();
  host.addTab(host.newTabSpec("one").setIndicator("TAB1").setContent(new Intent(this,Tab1Activity.class)));
  host.addTab(host.newTabSpec("two").setIndicator("TAB2").setContent(new Intent(this,Tab2Activity.class)));
}
 

Example 4

From project BreizhCamp-android, under directory /src/org/breizhjug/breizhcamp/.

Source file: BreizhCamp.java

  22 
vote

public void init(){
  TabHost tabHost=getTabHost();
  tabHost.clearAllTabs();
  Intent intent=new Intent().setClass(this,ProgramTabGroup.class);
  TabHost.TabSpec spec=tabHost.newTabSpec("program").setIndicator(new TabElement(this,"Accueil",R.drawable.program)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,SpeakersTabGroup.class);
  spec=tabHost.newTabSpec("speakers").setIndicator(new TabElement(this,"Speakers",R.drawable.speakers)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,RoomsTabGroup.class);
  spec=tabHost.newTabSpec("rooms").setIndicator(new TabElement(this,"Salles",R.drawable.rooms)).setContent(intent);
  tabHost.addTab(spec);
}
 

Example 5

From project CineShowTime-Android, under directory /Libraries/GreenDroid/src/greendroid/app/.

Source file: GDTabActivity.java

  22 
vote

public void addTab(String tag,CharSequence label,Intent intent){
  final TabHost host=getTabHost();
  View indicator=createTabIndicator(tag,label,getTabWidget());
  if (indicator == null) {
    final TextView textIndicator=(TextView)getLayoutInflater().inflate(R.layout.gd_tab_indicator,getTabWidget(),false);
    textIndicator.setText(label);
    indicator=textIndicator;
  }
  host.addTab(host.newTabSpec(tag).setIndicator(indicator).setContent(intent));
}
 

Example 6

From project cow, under directory /libs/ActionBarSherlock/test/app/src/com/actionbarsherlock/tests/app/.

Source file: Issue0038.java

  22 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.issue0038);
  TabHost tabHost=(TabHost)findViewById(android.R.id.tabhost);
  tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("First Tab Name").setContent(new Intent(this,InnerActivity.class)));
}
 

Example 7

From project cw-android, under directory /Activities/IntentTab/src/com/commonsware/android/intenttab/.

Source file: IntentTabDemo.java

  22 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  TabHost host=getTabHost();
  Intent i=new Intent(this,CWBrowser.class);
  i.putExtra(CWBrowser.URL,"http://commonsware.com");
  host.addTab(host.newTabSpec("one").setIndicator("CW").setContent(i));
  i=new Intent(i);
  i.putExtra(CWBrowser.URL,"http://www.android.com");
  host.addTab(host.newTabSpec("two").setIndicator("Android").setContent(i));
}
 

Example 8

From project cw-omnibus, under directory /WidgetCatalog/Tab/src/com/commonsware/android/tabhost/.

Source file: TabDemo.java

  22 
vote

@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  setContentView(R.layout.main);
  TabHost tabs=(TabHost)findViewById(R.id.tabhost);
  tabs.setup();
  TabHost.TabSpec spec=tabs.newTabSpec("tag1");
  spec.setContent(R.id.tab1);
  spec.setIndicator("Clock");
  tabs.addTab(spec);
  spec=tabs.newTabSpec("tag2");
  spec.setContent(R.id.tab2);
  spec.setIndicator("Button");
  tabs.addTab(spec);
}
 

Example 9

From project dccsched, under directory /src/com/underhilllabs/dccsched/ui/.

Source file: ScheduleActivity.java

  22 
vote

private void setupBlocksTab(String tag,long startMillis){
  final TabHost host=getTabHost();
  final long endMillis=startMillis + DateUtils.DAY_IN_MILLIS;
  final Uri blocksBetweenDirUri=Blocks.buildBlocksBetweenDirUri(startMillis,endMillis);
  final Intent intent=new Intent(Intent.ACTION_VIEW,blocksBetweenDirUri);
  intent.addCategory(Intent.CATEGORY_TAB);
  intent.putExtra(BlocksActivity.EXTRA_TIME_START,startMillis);
  intent.putExtra(BlocksActivity.EXTRA_TIME_END,endMillis);
  TimeZone.setDefault(UIUtils.CONFERENCE_TIME_ZONE);
  final String label=DateUtils.formatDateTime(this,startMillis,TIME_FLAGS);
  host.addTab(host.newTabSpec(tag).setIndicator(buildIndicator(label)).setContent(intent));
}
 

Example 10

From project devoxx-france-android-in-fine, under directory /src/com/infine/android/devoxx/ui/.

Source file: MapHotelFragment.java

  22 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_map_detail,null);
  final Intent intent=BaseActivity.fragmentArgumentsToIntent(getArguments());
  Bundle extras=intent.getExtras();
  if (extras != null) {
    startTab=extras.getInt(EXTRA_ROOM);
  }
  TabHost tabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  tabHost.setup();
  tabHost.addTab(tabHost.newTabSpec(TAG_LEVEL_0).setIndicator(buildIndicator(R.string.tab_map_0)).setContent(R.id.tab_map_level0));
  tabHost.addTab(tabHost.newTabSpec(TAG_LEVEL_1).setIndicator(buildIndicator(R.string.tab_map_1)).setContent(R.id.tab_map_level1));
  tabHost.setCurrentTab(startTab);
  return mRootView;
}
 

Example 11

From project DroidExpenses, under directory /de.simtem.android.expenses/src/de/simtem/android/expenses/.

Source file: Categories.java

  22 
vote

/** 
 * @see ActivityGroup#onCreate(Bundle)
 */
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final TabHost host=getTabHost();
  TabSpec expenseTab=host.newTabSpec(TAB_EXPENSES);
  expenseTab.setContent(new CategoryTab(TransactionType.Expense));
  expenseTab.setIndicator(getString(R.string.expenses));
  host.addTab(expenseTab);
  TabSpec revenueTab=host.newTabSpec(TAB_REVENUES);
  revenueTab.setContent(new CategoryTab(TransactionType.Revenue));
  revenueTab.setIndicator(getString(R.string.revenues));
  host.addTab(revenueTab);
}
 

Example 12

From project Gaggle, under directory /src/com/geeksville/gaggle/.

Source file: TopActivity.java

  22 
vote

/** 
 * @see android.app.ActivityGroup#onPause()
 */
@Override protected void onResume(){
  super.onResume();
  Units.instance.setFromPrefs(this);
  TabHost tabHost=getTabHost();
  GagglePrefs prefs=new GagglePrefs(this);
  tabHost.setKeepScreenOn(prefs.isKeepScreenOn());
}
 

Example 13

From project GreenDroid, under directory /GreenDroid/src/greendroid/app/.

Source file: GDTabActivity.java

  22 
vote

/** 
 * Add a new tab to this GDTabActivity
 * @param tag The tag associated this the new tab
 * @param label The label of the new tab
 * @param intent The Intent used to start the content of the tab
 */
public void addTab(String tag,CharSequence label,Intent intent){
  final TabHost host=getTabHost();
  View indicator=createTabIndicator(tag,label,getTabWidget());
  if (indicator == null) {
    final TextView textIndicator=(TextView)getLayoutInflater().inflate(R.layout.gd_tab_indicator,getTabWidget(),false);
    textIndicator.setText(label);
    indicator=textIndicator;
  }
  host.addTab(host.newTabSpec(tag).setIndicator(indicator).setContent(intent));
}
 

Example 14

From project iosched_1, under directory /src/com/google/android/apps/iosched/ui/.

Source file: ScheduleActivity.java

  22 
vote

private void setupBlocksTab(String tag,long startMillis){
  final TabHost host=getTabHost();
  final long endMillis=startMillis + DateUtils.DAY_IN_MILLIS;
  final Uri blocksBetweenDirUri=Blocks.buildBlocksBetweenDirUri(startMillis,endMillis);
  final Intent intent=new Intent(Intent.ACTION_VIEW,blocksBetweenDirUri);
  intent.addCategory(Intent.CATEGORY_TAB);
  intent.putExtra(BlocksActivity.EXTRA_TIME_START,startMillis);
  intent.putExtra(BlocksActivity.EXTRA_TIME_END,endMillis);
  TimeZone.setDefault(UIUtils.CONFERENCE_TIME_ZONE);
  final String label=DateUtils.formatDateTime(this,startMillis,TIME_FLAGS);
  host.addTab(host.newTabSpec(tag).setIndicator(buildIndicator(label)).setContent(intent));
}
 

Example 15

From project maven-android-plugin-samples, under directory /apidemos-android-10/application/src/main/java/com/example/android/apis/view/.

Source file: Tabs1.java

  22 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  TabHost tabHost=getTabHost();
  LayoutInflater.from(this).inflate(R.layout.tabs1,tabHost.getTabContentView(),true);
  tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("tab1").setContent(R.id.view1));
  tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator("tab2").setContent(R.id.view2));
  tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator("tab3").setContent(R.id.view3));
}
 

Example 16

From project NFCShopping, under directory /mobile phone client/NFCShopping/src/scut/bgooo/ui/.

Source file: NFCShoppingTab.java

  22 
vote

private void setupIntent(){
  this.mHost=getTabHost();
  TabHost localTabHost=this.mHost;
  localTabHost.addTab(buildTabSpec("concern_tab",R.string.main_concern,R.drawable.icon_1_n,this.mConcernIntent));
  localTabHost.addTab(buildTabSpec("compare_tab",R.string.main_comparation,R.drawable.icon_2_n,this.mCompareIntent));
  localTabHost.addTab(buildTabSpec("collection_tab",R.string.main_collection,R.drawable.collect,this.mCollectionIntent));
  localTabHost.addTab(buildTabSpec("discount_tab",R.string.main_discount,R.drawable.icon_4_n,this.mDiscountIntent));
  localTabHost.addTab(buildTabSpec("more_tab",R.string.main_more,R.drawable.icon_5_n,this.mMoreIntent));
}
 

Example 17

From project openpomo, under directory /src/it/unibz/pomodroid/.

Source file: TabPomodroid.java

  22 
vote

public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  TabHost mTabHost;
  mTabHost=getTabHost();
  mTabHost.addTab(mTabHost.newTabSpec("Activity Inventory").setContent(new Intent(this,ActivityInventorySheet.class)).setIndicator("Inventory",getResources().getDrawable(android.R.drawable.ic_menu_agenda)));
  mTabHost.addTab(mTabHost.newTabSpec("Todo Today").setContent(new Intent(this,TodoTodaySheet.class)).setIndicator("Todo Today",getResources().getDrawable(android.R.drawable.ic_menu_day)));
  mTabHost.addTab(mTabHost.newTabSpec("Services").setContent(new Intent(this,Services.class)).setIndicator("Services",getResources().getDrawable(android.R.drawable.ic_menu_send)));
}
 

Example 18

From project TaxiCop, under directory /src/com/taxicop/.

Source file: TaxiCop.java

  22 
vote

/** 
 * Called when the activity is first created. 
 */
protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final TabHost tabHost=getTabHost();
  tabHost.addTab(tabHost.newTabSpec("TAB1").setIndicator(getString(R.string.tab_request)).setContent(new Intent(this,TabRequest.class)));
  tabHost.addTab(tabHost.newTabSpec("TAB2").setIndicator(getString(R.string.tab_insert)).setContent(new Intent(this,TabInsert.class)));
  tabHost.addTab(tabHost.newTabSpec("TAB3").setIndicator(getString(R.string.tab_sync)).setContent(new Intent(this,TabSync.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
  String locale=this.getResources().getConfiguration().locale.getCountry();
  Log.d(TAG,"Locale:" + locale);
  Eula.show(this);
}
 

Example 19

From project Ushahidi_Android, under directory /Core/src/com/ushahidi/android/app/ui/tablet/.

Source file: CheckinTabFragment.java

  22 
vote

private void addTab(String indicator,int drawableId,Class<?> c){
  TabHost tabHost=mTabHost;
  TabHost.TabSpec spec=tabHost.newTabSpec(indicator);
  Intent intent=new Intent(getActivity(),c);
  View tabIndicator=LayoutInflater.from(getActivity()).inflate(R.layout.tab_indicator,tabHost.getTabWidget(),false);
  ImageView icon=(ImageView)tabIndicator.findViewById(R.id.icon);
  icon.setImageResource(drawableId);
  spec.setIndicator(tabIndicator);
  spec.setContent(intent);
  tabHost.addTab(spec);
}
 

Example 20

From project alljoyn_java, under directory /samples/android/chat/src/org/alljoyn/bus/sample/chat/.

Source file: TabWidget.java

  21 
vote

public void onCreate(Bundle savedInstanceState){
  Log.i(TAG,"onCreate()");
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,UseActivity.class);
  spec=tabHost.newTabSpec("use").setIndicator("",res.getDrawable(R.drawable.ic_tab_use)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,HostActivity.class);
  spec=tabHost.newTabSpec("host").setIndicator("",res.getDrawable(R.drawable.ic_tab_host)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 21

From project android-client, under directory /xwiki-android-client/src/org/xwiki/android/client/nav/.

Source file: PageViewActivity.java

  21 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.pageview);
  url=getIntent().getExtras().getString(INTENT_EXTRA_PUT_URL);
  if (getIntent().getExtras().getString(INTENT_EXTRA_PUT_USERNAME) != null && getIntent().getExtras().getString(INTENT_EXTRA_PUT_PASSWORD) != null) {
    username=getIntent().getExtras().getString(INTENT_EXTRA_PUT_USERNAME);
    password=getIntent().getExtras().getString(INTENT_EXTRA_PUT_PASSWORD);
    isSecured=true;
  }
  wikiName=getIntent().getExtras().getString(INTENT_EXTRA_PUT_WIKI_NAME);
  spaceName=getIntent().getExtras().getString(INTENT_EXTRA_PUT_SPACE_NAME);
  pageName=getIntent().getExtras().getString(INTENT_EXTRA_PUT_PAGE_NAME);
  TabHost tabHost=(TabHost)findViewById(android.R.id.tabhost);
  TabSpec TabSpecView=tabHost.newTabSpec("view");
  TabSpec TabSpecObjects=tabHost.newTabSpec("objects");
  TabSpec TabSpecClasses=tabHost.newTabSpec("classes");
  TabSpecView.setIndicator("View").setContent(setupPageViewerIntent());
  TabSpecObjects.setIndicator("Objects").setContent(setupObjectsViewerIntent());
  TabSpecClasses.setIndicator("Classes").setContent(setupClassViewerIntent());
  tabHost.addTab(TabSpecView);
  tabHost.addTab(TabSpecObjects);
  tabHost.addTab(TabSpecClasses);
}
 

Example 22

From project android-rackspacecloud, under directory /src/com/rackspacecloud/android/.

Source file: TabViewActivity.java

  21 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  TabHost tabs=getTabHost();
  TabHost.TabSpec spec=tabs.newTabSpec("tab1");
  spec.setContent(new Intent(this,ListServersActivity.class));
  spec.setIndicator("Cloud Servers",getResources().getDrawable(R.drawable.cloudservers_icon));
  tabs.addTab(spec);
  spec=tabs.newTabSpec("tab2");
  spec.setContent(new Intent(this,ListContainerActivity.class));
  spec.setIndicator("Cloud Files",getResources().getDrawable(R.drawable.cloudfiles));
  tabs.addTab(spec);
  spec=tabs.newTabSpec("tab3");
  spec.setContent(new Intent(this,ListLoadBalancersActivity.class));
  spec.setIndicator("Load Balancers",getResources().getDrawable(R.drawable.load_balancers_icon));
  tabs.addTab(spec);
}
 

Example 23

From project AndroidLab, under directory /src/src/de/tubs/ibr/android/ldap/core/activities/.

Source file: TabBrowserActivity.java

  21 
vote

private void showTabView(){
  setContentView(R.layout.tab);
  TabHost tabHost=(TabHost)findViewById(android.R.id.tabhost);
  TabSpec localTabSpec=tabHost.newTabSpec("tid1");
  localTabSpec.setIndicator(("Local"),getResources().getDrawable(R.drawable.home_icon));
  localTabSpec.setContent(new Intent(this,LocalTabActivity.class));
  tabHost.addTab(localTabSpec);
  TabSpec syncTabSpec=tabHost.newTabSpec("tid1");
  syncTabSpec.setIndicator(("Sync"),getResources().getDrawable(android.R.drawable.ic_popup_sync));
  syncTabSpec.setContent(new Intent(this,SyncTabActivity.class));
  tabHost.addTab(syncTabSpec);
  TabSpec ldapTabSpec=tabHost.newTabSpec("tid1");
  AccountManager accManager=AccountManager.get(this);
  Account[] accounts=accManager.getAccountsByType(this.getString(R.string.ACCOUNT_TYPE));
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  if (mPrefs.getString("selectedAccount","").equalsIgnoreCase("")) {
    Editor edit=mPrefs.edit();
    edit.putString("selectedAccount",accManager.getAccountsByType(this.getString(R.string.ACCOUNT_TYPE))[0].name);
    edit.commit();
  }
  String accountname=mPrefs.getString("selectedAccount","");
  boolean isFoundOnPref=false;
  for (  Account a : accounts) {
    if (a.name.equals(accountname)) {
      addSelectedAccountTab(a,accManager,ldapTabSpec,tabHost);
      isFoundOnPref=true;
      break;
    }
  }
  if (!isFoundOnPref)   addSelectedAccountTab(accounts[0],accManager,ldapTabSpec,tabHost);
}
 

Example 24

From project android_8, under directory /src/com/defuzeme/scheduler/.

Source file: Scheduler.java

  21 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  this.setContentView(R.layout.scheduler);
  final Intent intent=new Intent().setClass(this,SchedulerDay.class);
  final TabHost tabHost=getTabHost();
  this._resources=getResources();
  final String[] weekDays=this._resources.getStringArray(array.WeekDays);
  TabHost.TabSpec spec;
  for (int index=0; index < weekDays.length; index+=1) {
    spec=tabHost.newTabSpec(weekDays[index].substring(0,3)).setIndicator(weekDays[index].substring(0,3)).setContent(intent);
    tabHost.addTab(spec);
    tabHost.getTabWidget().getChildAt(index).getLayoutParams().height=this._tabHeight;
  }
  tabHost.setCurrentTab(0);
}
 

Example 25

From project android_packages_apps_Tag, under directory /src/com/android/apps/tag/.

Source file: TagBrowserActivity.java

  21 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  tabHost.addTab(tabHost.newTabSpec("tags").setIndicator(getText(R.string.tab_tags),res.getDrawable(R.drawable.ic_tab_all_tags)).setContent(new Intent().setClass(this,TagList.class)));
  tabHost.addTab(tabHost.newTabSpec("starred").setIndicator(getText(R.string.tab_starred),res.getDrawable(R.drawable.ic_tab_starred)).setContent(new Intent().setClass(this,TagList.class).putExtra(TagList.EXTRA_SHOW_STARRED_ONLY,true)));
  tabHost.addTab(tabHost.newTabSpec("mytag").setIndicator(getText(R.string.tab_my_tag),res.getDrawable(R.drawable.ic_tab_my_tag)).setContent(new Intent().setClass(this,MyTagList.class)));
  SharedPreferences preferences=getPreferences(Context.MODE_PRIVATE);
  if (!preferences.getBoolean(PREF_KEY_SHOW_INTRO,false)) {
    preferences.edit().putBoolean(PREF_KEY_SHOW_INTRO,true).apply();
    Intent intent=new Intent(this,AboutActivity.class);
    startActivity(intent);
  }
}
 

Example 26

From project androvoip, under directory /src/org/androvoip/ui/.

Source file: AndroVoIP.java

  21 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Intent intent=getIntent();
  setContentView(R.layout.main);
  final TabHost tab_host=getTabHost();
  tab_host.addTab(tab_host.newTabSpec(DIALER_TAB).setIndicator("Dialer",this.getResources().getDrawable(R.drawable.ic_tab_call)).setContent(R.id.dialer));
  tab_host.addTab(tab_host.newTabSpec(STATUS_TAB).setIndicator("Status",this.getResources().getDrawable(R.drawable.ic_tab_info_details)).setContent(R.id.status));
  tab_host.setCurrentTab(0);
  tab_host.setOnTabChangedListener(this);
  bindService(new Intent().setClassName("org.androvoip","org.androvoip.iax2.IAX2Service"),this,BIND_AUTO_CREATE);
  ((Button)findViewById(R.id.status_refresh)).setOnClickListener(this);
  ((Button)findViewById(R.id.send_button)).setOnClickListener(this);
  ((Button)findViewById(R.id.hangup_button)).setOnClickListener(this);
  ((EditText)findViewById(R.id.dialer_number)).selectAll();
  if (Intent.ACTION_VIEW.equals(intent.getAction())) {
    final Uri data=intent.getData();
    final String scheme=data.getScheme();
    final String path=data.getSchemeSpecificPart();
    Log.d("org.androvoip","Got a URI: " + scheme + " - "+ path);
  }
}
 

Example 27

From project Book-Catalogue, under directory /src/com/eleybourn/bookcatalogue/.

Source file: BookEditFields.java

  21 
vote

private void showAnthologyTab(){
  CheckBox cb=(CheckBox)findViewById(R.id.anthology);
  try {
    TabHost tabHost=((TabActivity)getParent()).getTabHost();
    if (cb.isChecked()) {
      Resources res=getResources();
      TabHost.TabSpec spec;
      Intent intent=new Intent().setClass(BookEditFields.this,BookEditAnthology.class);
      intent.putExtra(CatalogueDBAdapter.KEY_ROWID,mRowId);
      spec=tabHost.newTabSpec("edit_book_anthology").setIndicator(res.getString(R.string.edit_book_anthology),res.getDrawable(R.drawable.ic_tab_anthology)).setContent(intent);
      tabHost.addTab(spec);
    }
 else {
      tabHost.getTabWidget().removeViewAt(3);
    }
  }
 catch (  Exception e) {
  }
}
 

Example 28

From project CheckIn4Me, under directory /src/com/davidivins/checkin4me/activities/.

Source file: MainTabbedContainer.java

  21 
vote

public void onCreate(Bundle saved_instance_state){
  super.onCreate(saved_instance_state);
  GeneratedResources.generate(this);
  Log.i(TAG,"" + GeneratedResources.getLayout("main"));
  setContentView(GeneratedResources.getLayout("main"));
  Resources res=getResources();
  TabHost tab_host=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,ServiceConnection.class);
  spec=tab_host.newTabSpec("connect_services").setIndicator("Connect",res.getDrawable(GeneratedResources.getLayout("ic_tab_connect_services"))).setContent(intent);
  tab_host.addTab(spec);
  intent=new Intent().setClass(this,NearbyPlaces.class);
  spec=tab_host.newTabSpec("nearby_places").setIndicator("Nearby Places",res.getDrawable(GeneratedResources.getLayout("ic_tab_nearby_places"))).setContent(intent);
  tab_host.addTab(spec);
  intent=new Intent().setClass(this,Settings.class);
  spec=tab_host.newTabSpec("settings").setIndicator("Settings",res.getDrawable(GeneratedResources.getLayout("ic_tab_settings"))).setContent(intent);
  tab_host.addTab(spec);
  int tab_to_display=this.getIntent().getIntExtra("tab_to_display",-1);
  if (-1 != tab_to_display) {
    tab_host.setCurrentTab(tab_to_display);
  }
 else   if (Intent.ACTION_SEARCH.equals(getIntent().getAction()) && getIntent().getStringExtra(SearchManager.QUERY) != null) {
    Log.i(TAG,"query = " + getIntent().getStringExtra(SearchManager.QUERY));
    this.getIntent().putExtra("query",getIntent().getStringExtra(SearchManager.QUERY));
    tab_host.setCurrentTab(NEARBY_PLACES_TAB);
  }
 else {
    if (Services.getInstance(this).atLeastOneConnected())     tab_host.setCurrentTab(NEARBY_PLACES_TAB);
 else     tab_host.setCurrentTab(SERVICE_CONNECTION_TAB);
  }
  Ad ad=new Ad(this);
  ad.refreshAd();
}
 

Example 29

From project com.juick.android, under directory /src/com/juick/android/.

Source file: PlaceEditActivity.java

  21 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  Utils.updateTheme(this);
  super.onCreate(savedInstanceState);
  Intent i=getIntent();
  lat=i.getDoubleExtra("lat",0);
  lon=i.getDoubleExtra("lon",0);
  if (lat == 0 && lon == 0) {
    setResult(RESULT_CANCELED);
    finish();
  }
  setContentView(R.layout.placeedit);
  TabHost tabHost=(TabHost)findViewById(android.R.id.tabhost);
  tabHost.setup();
  tabHost.addTab(tabHost.newTabSpec(TABDETAILS).setIndicator(getResources().getString(R.string.Details),getResources().getDrawable(R.drawable.ic_tab_info)).setContent(R.id.tabDetails));
  tabHost.addTab(tabHost.newTabSpec(TABMAP).setIndicator(getResources().getString(R.string.Map),getResources().getDrawable(R.drawable.ic_tab_map)).setContent(R.id.tabMap));
  tabHost.setOnTabChangedListener(this);
  etName=(EditText)findViewById(R.id.editName);
  etDescription=(EditText)findViewById(R.id.editDescription);
  etTags=(EditText)findViewById(R.id.editTags);
  etURL=(EditText)findViewById(R.id.editURL);
  ((Button)findViewById(R.id.buttonAdd)).setOnClickListener(this);
  mapView=(MapView)findViewById(R.id.mapView);
  mapView.setBuiltInZoomControls(true);
  mapView.getController().setCenter(new GeoPoint((int)(lat * 1000000),(int)(lon * 1000000)));
  mapView.getController().setZoom(18);
  myLocation=new MyLocationOverlay(this,mapView);
  mapView.getOverlays().add(myLocation);
}
 

Example 30

From project creamed_glacier_app_settings, under directory /src/com/android/settings/applications/.

Source file: ManageApplications.java

  21 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mInflater=inflater;
  mRootView=inflater.inflate(R.layout.manage_applications,null);
  mLoadingContainer=mRootView.findViewById(R.id.loading_container);
  mListContainer=mRootView.findViewById(R.id.list_container);
  ListView lv=(ListView)mListContainer.findViewById(android.R.id.list);
  View emptyView=mListContainer.findViewById(com.android.internal.R.id.empty);
  if (emptyView != null) {
    lv.setEmptyView(emptyView);
  }
  lv.setOnItemClickListener(this);
  lv.setSaveEnabled(true);
  lv.setItemsCanFocus(true);
  lv.setOnItemClickListener(this);
  lv.setTextFilterEnabled(true);
  mListView=lv;
  lv.setRecyclerListener(mApplicationsAdapter);
  mListView.setAdapter(mApplicationsAdapter);
  mColorBar=(LinearColorBar)mListContainer.findViewById(R.id.storage_color_bar);
  mStorageChartLabel=(TextView)mListContainer.findViewById(R.id.storageChartLabel);
  mUsedStorageText=(TextView)mListContainer.findViewById(R.id.usedStorageText);
  mFreeStorageText=(TextView)mListContainer.findViewById(R.id.freeStorageText);
  mRunningProcessesView=(RunningProcessesView)mRootView.findViewById(R.id.running_processes);
  mCreatedRunning=mResumedRunning=false;
  mCurView=VIEW_NOTHING;
  mTabHost=(TabHost)mInflater.inflate(R.layout.manage_apps_tab_content,container,false);
  mTabHost.setup();
  final TabHost tabHost=mTabHost;
  tabHost.addTab(tabHost.newTabSpec(TAB_DOWNLOADED).setIndicator(getActivity().getString(R.string.filter_apps_third_party),getActivity().getResources().getDrawable(R.drawable.ic_tab_download)).setContent(this));
  if (!Environment.isExternalStorageEmulated()) {
    tabHost.addTab(tabHost.newTabSpec(TAB_SDCARD).setIndicator(getActivity().getString(R.string.filter_apps_onsdcard),getActivity().getResources().getDrawable(R.drawable.ic_tab_sdcard)).setContent(this));
  }
  tabHost.addTab(tabHost.newTabSpec(TAB_RUNNING).setIndicator(getActivity().getString(R.string.filter_apps_running),getActivity().getResources().getDrawable(R.drawable.ic_tab_running)).setContent(this));
  tabHost.addTab(tabHost.newTabSpec(TAB_ALL).setIndicator(getActivity().getString(R.string.filter_apps_all),getActivity().getResources().getDrawable(R.drawable.ic_tab_all)).setContent(this));
  tabHost.setCurrentTabByTag(mDefaultTab);
  tabHost.setOnTabChangedListener(this);
  prepareCustomPreferencesList(container,mTabHost,mListView,false);
  return mTabHost;
}
 

Example 31

From project daily-money, under directory /dailymoney/src/com/bottleworks/dailymoney/ui/.

Source file: AccountMgntActivity.java

  21 
vote

private void initialTab(){
  TabHost tabs=(TabHost)findViewById(R.id.accmgnt_tabs);
  tabs.setup();
  AccountType[] ata=AccountType.getSupportedType();
  Resources r=getResources();
  for (  AccountType at : ata) {
    TabSpec tab=tabs.newTabSpec(at.getType());
    tab.setIndicator(AccountType.getDisplay(i18n,tab.getTag()),r.getDrawable(at.getDrawable()));
    tab.setContent(R.id.accmgnt_list);
    tabs.addTab(tab);
    if (currTab == null) {
      currTab=tab.getTag();
    }
  }
  if (ata.length > 1) {
    tabs.setCurrentTab(1);
    tabs.setCurrentTab(0);
  }
  tabs.setOnTabChangedListener(this);
}
 

Example 32

From project Gibberbot, under directory /src/info/guardianproject/otr/app/im/ui/.

Source file: OldTabbedContainer.java

  21 
vote

@Override public void onCreate(Bundle smurfy){
  super.onCreate(smurfy);
  String passThruAction=getIntent().getAction();
  Uri passThruData=getIntent().getData();
  Bundle passThruExtras=getIntent().getExtras();
  setContentView(R.layout.tab_container);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,ContactListActivity.class);
  intent.setAction(passThruAction);
  intent.setData(passThruData);
  intent.putExtras(passThruExtras);
  spec=tabHost.newTabSpec("contacts").setIndicator(getString(R.string.menu_contact_list),res.getDrawable(R.drawable.ic_tab_contacts)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,ChatListActivity.class);
  intent.setAction(passThruAction);
  intent.setData(passThruData);
  intent.putExtras(passThruExtras);
  spec=tabHost.newTabSpec("chats").setIndicator(getString(R.string.title_chats),res.getDrawable(R.drawable.ic_tab_chats)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 33

From project gmarks-android, under directory /src/main/java/org/thomnichols/android/gmarks/.

Source file: ListsTabActivity.java

  21 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.lists_tab_view);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,ListsListActivity.class).putExtra(BookmarkList.PARAM_CATEGORY,BookmarkList.LISTS_PRIVATE);
  spec=tabHost.newTabSpec("private").setIndicator("Private",res.getDrawable(R.xml.private_lists_tab)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,ListsListActivity.class).putExtra(BookmarkList.PARAM_CATEGORY,BookmarkList.LISTS_SHARED);
  spec=tabHost.newTabSpec("shared").setIndicator("Shared",res.getDrawable(R.xml.private_lists_tab)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,ListsListActivity.class).putExtra(BookmarkList.PARAM_CATEGORY,BookmarkList.LISTS_PUBLIC);
  spec=tabHost.newTabSpec("public").setIndicator("Public",res.getDrawable(R.xml.private_lists_tab)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 34

From project GraduationProject, under directory /G-Card/src/Hello/Tab/Widget/.

Source file: HelloTabWidgetActivity.java

  21 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  TabHost tabhost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  Resources res=getResources();
  intent=new Intent().setClass(this,NameCardActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  spec=tabhost.newTabSpec("????");
  spec.setIndicator("????",res.getDrawable(R.drawable.ic_tab_namecard));
  spec.setContent(intent);
  tabhost.addTab(spec);
  intent=new Intent().setClass(this,ContactsActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  spec=tabhost.newTabSpec("???");
  spec.setIndicator("???",res.getDrawable(R.drawable.ic_tab_contacts));
  spec.setContent(intent);
  tabhost.addTab(spec);
  intent=new Intent().setClass(this,CameraActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  spec=tabhost.newTabSpec("????");
  spec.setIndicator("????",res.getDrawable(R.drawable.ic_tab_camera));
  spec.setContent(intent);
  tabhost.addTab(spec);
  intent=new Intent().setClass(this,OptionsActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  spec=tabhost.newTabSpec("??");
  spec.setIndicator("??",res.getDrawable(R.drawable.ic_tab_options));
  spec.setContent(intent);
  tabhost.addTab(spec);
  for (int i=0; i < tabhost.getTabWidget().getChildCount(); i++) {
    tabhost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#2e333e"));
  }
}
 

Example 35

From project greenhouse-android, under directory /src/com/springsource/greenhouse/.

Source file: MainTabWidget.java

  21 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec tabSpec;
  Intent intent;
  intent=new Intent();
  intent.setClass(this,EventsActivity.class);
  tabSpec=tabHost.newTabSpec("events");
  tabSpec.setIndicator("Events",res.getDrawable(R.drawable.ic_tab_events));
  tabSpec.setContent(intent);
  tabHost.addTab(tabSpec);
  intent=new Intent();
  intent.setClass(this,ProfileActivity.class);
  tabSpec=tabHost.newTabSpec("profile");
  tabSpec.setIndicator("Profile",res.getDrawable(R.drawable.ic_tab_profile));
  tabSpec.setContent(intent);
  tabHost.addTab(tabSpec);
  intent=new Intent();
  intent.setClass(this,InfoActivity.class);
  tabSpec=tabHost.newTabSpec("info");
  tabSpec.setIndicator("Info",res.getDrawable(R.drawable.ic_tab_info));
  tabSpec.setContent(intent);
  tabHost.addTab(tabSpec);
}
 

Example 36

From project Hax-Launcher, under directory /src/com/t3hh4xx0r/haxlauncher/.

Source file: FocusHelper.java

  21 
vote

/** 
 * Handles key events in a AppsCustomize tab between the last tab view and the shop button.
 */
static boolean handleAppsCustomizeTabKeyEvent(View v,int keyCode,KeyEvent e){
  final TabHost tabHost=findTabHostParent(v);
  final ViewGroup contents=(ViewGroup)tabHost.findViewById(android.R.id.tabcontent);
  final View shop=tabHost.findViewById(R.id.market_button);
  final int action=e.getAction();
  final boolean handleKeyEvent=(action != KeyEvent.ACTION_UP);
  boolean wasHandled=false;
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_RIGHT:
    if (handleKeyEvent) {
      if (v != shop) {
        shop.requestFocus();
      }
    }
  wasHandled=true;
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
if (handleKeyEvent) {
if (v == shop) {
  contents.requestFocus();
  wasHandled=true;
}
}
break;
default :
break;
}
return wasHandled;
}
 

Example 37

From project iohack, under directory /src/org/alljoyn/bus/sample/chat/.

Source file: TabWidget.java

  21 
vote

public void onCreate(Bundle savedInstanceState){
  Log.i(TAG,"onCreate()");
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,UseActivity.class);
  spec=tabHost.newTabSpec("use").setIndicator("",res.getDrawable(R.drawable.ic_tab_use)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,HostActivity.class);
  spec=tabHost.newTabSpec("host").setIndicator("",res.getDrawable(R.drawable.ic_tab_host)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 38

From project jstock-android, under directory /src/org/yccheok/jstock/activity/.

Source file: MainActivity.java

  21 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,BuyActivity.class);
  spec=tabHost.newTabSpec("buy").setIndicator(getString(R.string.buy),res.getDrawable(R.drawable.ic_tab_buy)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,SellActivity.class);
  spec=tabHost.newTabSpec("sell").setIndicator(getString(R.string.sell),res.getDrawable(R.drawable.ic_tab_sell)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,DividendActivity.class);
  spec=tabHost.newTabSpec("dividend").setIndicator(getString(R.string.dividend),res.getDrawable(R.drawable.ic_tab_dividend)).setContent(intent);
  tabHost.addTab(spec);
}
 

Example 39

From project LitHub, under directory /LitHub-Android/src/us/lithub/ui/activity/.

Source file: Discover.java

  21 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_discover);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,TabRecentlyAdded.class);
  spec=tabHost.newTabSpec("added").setIndicator("Recently Added",res.getDrawable(R.drawable.ic_tab_recently_added)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,TabRecentlyStarred.class);
  spec=tabHost.newTabSpec("albums").setIndicator("Recently Starred",res.getDrawable(R.drawable.ic_tab_recently_starred)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,TabRecentlyLent.class);
  spec=tabHost.newTabSpec("songs").setIndicator("Recently Lent",res.getDrawable(R.drawable.ic_tab_recently_lent)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(1);
}
 

Example 40

From project No-Pain-No-Game, under directory /src/edu/ucla/cs/nopainnogame/.

Source file: NoPainNoGame.java

  21 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,HomeActivity.class);
  spec=tabHost.newTabSpec("home").setIndicator("Home",res.getDrawable(R.drawable.ic_tab_home)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,PedometerActivity.class);
  spec=tabHost.newTabSpec("pedometer").setIndicator("Pedometer",res.getDrawable(R.drawable.ic_tab_pedometer)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,LearnActivity.class);
  spec=tabHost.newTabSpec("learn").setIndicator("Learn",res.getDrawable(R.drawable.ic_tab_info)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,WatchActivity.class);
  spec=tabHost.newTabSpec("watch").setIndicator("Watch TV",res.getDrawable(R.drawable.ic_tab_watch)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,ProgressActivity.class);
  spec=tabHost.newTabSpec("progress").setIndicator("Progress",res.getDrawable(R.drawable.ic_tab_progress)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 41

From project opensudoku, under directory /OpenSudoku/src/cz/romario/opensudoku/gui/inputmethod/.

Source file: IMPopupDialog.java

  21 
vote

/** 
 * Creates view with two tabs, first for number in cell selection, second for note editing.
 * @return
 */
private TabHost createTabView(){
  TabHost tabHost=new TabHost(mContext,null);
  tabHost.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  LinearLayout linearLayout=new LinearLayout(mContext);
  linearLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  linearLayout.setOrientation(LinearLayout.VERTICAL);
  TabWidget tabWidget=new TabWidget(mContext);
  tabWidget.setId(android.R.id.tabs);
  FrameLayout frameLayout=new FrameLayout(mContext);
  frameLayout.setId(android.R.id.tabcontent);
  linearLayout.addView(tabWidget);
  linearLayout.addView(frameLayout);
  tabHost.addView(linearLayout);
  tabHost.setup();
  final View editNumberView=createEditNumberView();
  final View editNoteView=createEditNoteView();
  tabHost.addTab(tabHost.newTabSpec("number").setIndicator(mContext.getString(R.string.select_number)).setContent(new TabHost.TabContentFactory(){
    @Override public View createTabContent(    String tag){
      return editNumberView;
    }
  }
));
  tabHost.addTab(tabHost.newTabSpec("note").setIndicator(mContext.getString(R.string.edit_note)).setContent(new TabHost.TabContentFactory(){
    @Override public View createTabContent(    String tag){
      return editNoteView;
    }
  }
));
  return tabHost;
}
 

Example 42

From project opensudoku-blackberry, under directory /opensudoku/src/net/bmagro/blackberry/opensudoku/gui/inputmethod/.

Source file: IMPopupDialog.java

  21 
vote

/** 
 * Creates view with two tabs, first for number in cell selection, second for note editing.
 * @return
 */
private TabHost createTabView(){
  TabHost tabHost=new TabHost(mContext,null);
  tabHost.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  LinearLayout linearLayout=new LinearLayout(mContext);
  linearLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  linearLayout.setOrientation(LinearLayout.VERTICAL);
  TabWidget tabWidget=new TabWidget(mContext);
  tabWidget.setId(android.R.id.tabs);
  FrameLayout frameLayout=new FrameLayout(mContext);
  frameLayout.setId(android.R.id.tabcontent);
  linearLayout.addView(tabWidget);
  linearLayout.addView(frameLayout);
  tabHost.addView(linearLayout);
  tabHost.setup();
  final View editNumberView=createEditNumberView();
  final View editNoteView=createEditNoteView();
  tabHost.addTab(tabHost.newTabSpec("number").setIndicator(mContext.getString(R.string.select_number)).setContent(new TabHost.TabContentFactory(){
    @Override public View createTabContent(    String tag){
      return editNumberView;
    }
  }
));
  tabHost.addTab(tabHost.newTabSpec("note").setIndicator(mContext.getString(R.string.edit_note)).setContent(new TabHost.TabContentFactory(){
    @Override public View createTabContent(    String tag){
      return editNoteView;
    }
  }
));
  return tabHost;
}
 

Example 43

From project PowerTutor, under directory /src/edu/umich/PowerTutor/ui/.

Source file: PowerTabs.java

  21 
vote

public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.power_tabs);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent=new Intent(this,PowerViewer.class);
  intent.putExtras(getIntent());
  spec=tabHost.newTabSpec("Charts").setIndicator("Chart View").setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent(this,PowerPie.class);
  intent.putExtras(getIntent());
  spec=tabHost.newTabSpec("Pie").setIndicator("Pie View").setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent(this,MiscView.class);
  intent.putExtras(getIntent());
  spec=tabHost.newTabSpec("Stat").setIndicator("Stat View").setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 44

From project SimpleMoney-Android, under directory /SimpleMoney/.settings/src/com/hermes/.

Source file: PendingTransactions.java

  21 
vote

public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.pending_transactions);
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent=new Intent().setClass(this,Bills.class);
  spec=tabHost.newTabSpec("bills");
  spec.setIndicator("Bills");
  spec.setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,Invoices.class);
  spec=tabHost.newTabSpec("invoices");
  spec.setIndicator("Invoices");
  spec.setContent(intent);
  tabHost.addTab(spec);
}
 

Example 45

From project SOCIETIES-SCE-Services, under directory /3rdPartyServices/DisasterManagement/iDisaster/src/com/disaster/idisaster/.

Source file: DisasterActivity.java

  21 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.disaster_layout);
  TextView title=(TextView)findViewById(R.id.disasterLabel);
  title.setText(iDisasterApplication.getInstance().disasterTeamName);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,FeedListActivity.class);
  spec=tabHost.newTabSpec("activities").setIndicator("Activities",res.getDrawable(R.drawable.ic_tab_activities)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,MemberListActivity.class);
  spec=tabHost.newTabSpec("members").setIndicator("Members",res.getDrawable(R.drawable.ic_tab_members)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,ServiceListActivity.class);
  spec=tabHost.newTabSpec("services").setIndicator("Services",res.getDrawable(R.drawable.ic_tab_services)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 46

From project spring-data-document-examples, under directory /couchdb-myrestaurants-android/src/com/springsource/myrestaurants/activities/.

Source file: MainTabWidget.java

  21 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec tabSpec;
  Intent intent;
  intent=new Intent();
  intent.setClass(this,RestListingActivity.class);
  tabSpec=tabHost.newTabSpec("restaurants");
  tabSpec.setIndicator("Restaurants",res.getDrawable(R.drawable.ic_tab_events));
  tabSpec.setContent(intent);
  tabHost.addTab(tabSpec);
  intent=new Intent();
  intent.setClass(this,FavoritesListingActivity.class);
  tabSpec=tabHost.newTabSpec("favorites");
  tabSpec.setIndicator("Favorites",res.getDrawable(R.drawable.ic_tab_profile));
  tabSpec.setContent(intent);
  tabHost.addTab(tabSpec);
  intent=new Intent();
  intent.setClass(this,InfoActivity.class);
  tabSpec=tabHost.newTabSpec("info");
  tabSpec.setIndicator("Info",res.getDrawable(R.drawable.ic_tab_info));
  tabSpec.setContent(intent);
  tabHost.addTab(tabSpec);
}
 

Example 47

From project ToDo-List-Widget, under directory /src/org/chrisbailey/todo/activities/.

Source file: ToDoWidgetConfigTab.java

  21 
vote

public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.tabs);
  Resources res=getResources();
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,SizesConfiguration.class);
  spec=tabHost.newTabSpec("config").setIndicator("",res.getDrawable(R.drawable.ic_menu_clear_playlist)).setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,PreferencesActivity.class);
  spec=tabHost.newTabSpec("preferences").setIndicator("",res.getDrawable(android.R.drawable.ic_menu_preferences)).setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(1);
}
 

Example 48

From project wsdot-android-app, under directory /src/gov/wa/wsdot/android/wsdot/.

Source file: BorderWaitTabs.java

  21 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.tabs);
  ((TextView)findViewById(R.id.sub_section)).setText("Border Wait Times");
  TabHost tabHost=getTabHost();
  tabHost.getTabWidget().setBackgroundColor(0xff017359);
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(BorderWaitTabs.this,BorderWaitNorthbound.class);
  spec=tabHost.newTabSpec("northbound").setIndicator("Northbound").setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(BorderWaitTabs.this,BorderWaitSouthbound.class);
  spec=tabHost.newTabSpec("southbound").setIndicator("Southbound").setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTabByTag("northbound");
}
 

Example 49

From project ActionBarSherlock, under directory /samples/fragments/src/com/actionbarsherlock/sample/fragments/.

Source file: FragmentTabs.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  setTheme(SampleList.THEME);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.fragment_tabs);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTabManager=new TabManager(this,mTabHost,R.id.realtabcontent);
  mTabManager.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),FragmentStackSupport.CountingFragment.class,null);
  mTabManager.addTab(mTabHost.newTabSpec("contacts").setIndicator("Contacts"),LoaderCursorSupport.CursorLoaderListFragment.class,null);
  mTabManager.addTab(mTabHost.newTabSpec("custom").setIndicator("Custom"),LoaderCustomSupport.AppListFragment.class,null);
  mTabManager.addTab(mTabHost.newTabSpec("throttle").setIndicator("Throttle"),LoaderThrottleSupport.ThrottledLoaderListFragment.class,null);
  if (savedInstanceState != null) {
    mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
  }
}
 

Example 50

From project Android, under directory /app/src/main/java/com/github/mobile/ui/.

Source file: TabPagerActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(getContentView());
  pager=(ViewPager)findViewById(id.vp_pages);
  pager.setOnPageChangeListener(this);
  host=(TabHost)findViewById(id.th_tabs);
  host.setup();
  host.setOnTabChangedListener(this);
}
 

Example 51

From project android-shuffle, under directory /client/src/org/dodgybits/shuffle/android/list/activity/task/.

Source file: TabbedDueActionsActivity.java

  19 
vote

@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  mTabHost.setup();
  mTabHost.addTab(createTabSpec(R.string.day_button_title,PredefinedQuery.dueToday.name(),android.R.drawable.ic_menu_day));
  mTabHost.addTab(createTabSpec(R.string.week_button_title,PredefinedQuery.dueNextWeek.name(),android.R.drawable.ic_menu_week));
  mTabHost.addTab(createTabSpec(R.string.month_button_title,PredefinedQuery.dueNextMonth.name(),android.R.drawable.ic_menu_month));
  mTabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener(){
    public void onTabChanged(    String tabId){
      Log.d(cTag,"Switched to tab: " + tabId);
      if (tabId == null)       tabId=PredefinedQuery.dueToday.name();
      mMode=PredefinedQuery.valueOf(tabId);
      updateCursor();
    }
  }
);
}
 

Example 52

From project android-xbmcremote-sandbox, under directory /src/org/xbmc/android/remotesandbox/ui/base/.

Source file: BaseFragmentTabsActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final long start=System.currentTimeMillis();
  setContentView(R.layout.activity_fragment_tabs_pager);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mViewPager=(ViewPager)findViewById(R.id.tab_pager);
  mTabHost.setup();
  mTabsAdapter=new TabsAdapter(this,mTabHost,mViewPager);
  if (savedInstanceState == null) {
    onCreateTabs();
  }
 else {
    mTabHost.setCurrentTabByTag(savedInstanceState.getString(EXTRA_TAB));
  }
  final HorizontalScrollView scroller=(HorizontalScrollView)findViewById(R.id.tab_scroller);
  mTabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener(){
    @Override public void onTabChanged(    String tabId){
      final int position=mTabHost.getCurrentTab();
      final View tab=mTabWidget.getChildTabViewAt(position);
      scroller.smoothScrollTo(tab.getLeft(),0);
      mViewPager.setCurrentItem(position);
    }
  }
);
  Log.d(TAG,"onCreate() done in " + (System.currentTimeMillis() - start) + "ms.");
}
 

Example 53

From project android_5, under directory /src/aarddict/android/.

Source file: DictionaryInfoActivity.java

  19 
vote

@Override void initUI(){
  setContentView(R.layout.dict_info);
  tabs=(TabHost)findViewById(android.R.id.tabhost);
  tabs.setup();
  setTitle(R.string.titleDictionaryInfoActivity);
}
 

Example 54

From project android_7, under directory /src/org/immopoly/android/app/.

Source file: ImmopolyActivity.java

  19 
vote

/** 
 * Init the game
 */
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mTracker=GoogleAnalyticsTracker.getInstance();
  mTracker.startNewSession(TrackingManager.UA_ACCOUNT,Const.ANALYTICS_INTERVAL,getApplicationContext());
  UserDataManager.instance.setActivity(this);
  setContentView(R.layout.immopoly_activity);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTabManager=new TabManager(this,mTabHost,R.id.fragment_container);
  addTab(R.drawable.ic_tab_map,FRAGMENT_MAP,MapFragment.class,false);
  addTab(R.drawable.ic_tab_portfolio,"portfolio",PortfolioListFragment.class,false);
  addTab(R.drawable.ic_tab_portfolio,"portfolio_map",PortfolioMapFragment.class,true);
  addTab(R.drawable.ic_tab_profile,"profile",ProfileFragment.class,false);
  addTab(R.drawable.ic_tab_history,"history",HistoryFragment.class,false);
  FragmentManager.enableDebugLogging(true);
  if (savedInstanceState != null) {
    mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
  }
 else {
    SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
    if (prefs.getBoolean("showFirstAid",true)) {
      new Handler().postDelayed(new Runnable(){
        @Override public void run(){
          new FirstAidDialog(ImmopolyActivity.this).show();
        }
      }
,4000);
    }
  }
  VERISONINFO=getVersionInfo();
}
 

Example 55

From project AquaNotesTest, under directory /src/com/google/android/apps/iosched/ui/.

Source file: SearchActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  mQuery=intent.getStringExtra(SearchManager.QUERY);
  setContentView(R.layout.activity_search);
  getActivityHelper().setupActionBar(getTitle(),0);
  final CharSequence title=getString(R.string.title_search_query,mQuery);
  getActivityHelper().setActionBarTitle(title);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mTabHost.setup();
  setupSessionsTab();
  setupVendorsTab();
}
 

Example 56

From project conference-mobile-app, under directory /android-app/src/com/google/android/apps/iosched/ui/.

Source file: SearchActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  mQuery=intent.getStringExtra(SearchManager.QUERY);
  setContentView(R.layout.activity_search);
  getActivityHelper().setupActionBar(getTitle(),0);
  final CharSequence title=getString(R.string.title_search_query,mQuery);
  getActivityHelper().setActionBarTitle(title);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mTabHost.setup();
  setupSessionsTab();
  setupVendorsTab();
}
 

Example 57

From project dcnyc10-android, under directory /android/src/com/lullabot/android/apps/iosched/ui/.

Source file: SearchActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  mQuery=intent.getStringExtra(SearchManager.QUERY);
  setContentView(R.layout.activity_search);
  getActivityHelper().setupActionBar(getTitle(),0);
  final CharSequence title=getString(R.string.title_search_query,mQuery);
  getActivityHelper().setActionBarTitle(title);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mTabHost.setup();
  setupSessionsTab();
  setupVendorsTab();
}
 

Example 58

From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/samples/fragments/src/com/actionbarsherlock/sample/fragments/.

Source file: FragmentTabs.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  setTheme(SampleList.THEME);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.fragment_tabs);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTabManager=new TabManager(this,mTabHost,R.id.realtabcontent);
  mTabManager.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),FragmentStackSupport.CountingFragment.class,null);
  mTabManager.addTab(mTabHost.newTabSpec("contacts").setIndicator("Contacts"),LoaderCursorSupport.CursorLoaderListFragment.class,null);
  mTabManager.addTab(mTabHost.newTabSpec("custom").setIndicator("Custom"),LoaderCustomSupport.AppListFragment.class,null);
  mTabManager.addTab(mTabHost.newTabSpec("throttle").setIndicator("Throttle"),LoaderThrottleSupport.ThrottledLoaderListFragment.class,null);
  if (savedInstanceState != null) {
    mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
  }
}
 

Example 59

From project gddsched2, under directory /trunk/android/src/com/google/android/apps/iosched2/ui/.

Source file: SearchActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  SetupHelper.loadCurrentSetup(this);
  Intent intent=getIntent();
  mQuery=intent.getStringExtra(SearchManager.QUERY);
  doEasterEgg(mQuery);
  setContentView(R.layout.activity_search);
  getActivityHelper().setupActionBar(getTitle(),0);
  final CharSequence title=getString(R.string.title_search_query,mQuery);
  getActivityHelper().setActionBarTitle(title);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mTabHost.setup();
  setupSessionsTab();
  if (Setup.FEATURE_VENDORS_ON) {
    setupVendorsTab();
  }
}
 

Example 60

From project Hawksword, under directory /src/com/bw/hawksword/ocr/.

Source file: WordhistoryActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.history);
  prefs=PreferenceManager.getDefaultSharedPreferences(this);
  listFavourite=(ListView)findViewById(R.id.listFavourite);
  listHistory=(ListView)findViewById(R.id.listHistory);
  tabHost=(TabHost)findViewById(R.id.tabhost);
  tabHost.setup();
  TabSpec spec1=tabHost.newTabSpec("History");
  spec1.setContent(R.id.tab1);
  spec1.setIndicator("History",getResources().getDrawable(android.R.drawable.ic_menu_recent_history));
  TabSpec spec2=tabHost.newTabSpec("Favourite");
  spec2.setContent(R.id.tab2);
  spec2.setIndicator("Favourite",getResources().getDrawable(android.R.drawable.btn_star_big_on));
  tabHost.addTab(spec1);
  tabHost.addTab(spec2);
}
 

Example 61

From project iosched, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SearchActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  mQuery=intent.getStringExtra(SearchManager.QUERY);
  setContentView(R.layout.activity_search);
  getActivityHelper().setupActionBar(getTitle(),0);
  final CharSequence title=getString(R.string.title_search_query,mQuery);
  getActivityHelper().setActionBarTitle(title);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mTabHost.setup();
  setupSessionsTab();
  setupVendorsTab();
}
 

Example 62

From project iosched2011, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SearchActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  mQuery=intent.getStringExtra(SearchManager.QUERY);
  setContentView(R.layout.activity_search);
  getActivityHelper().setupActionBar(getTitle(),0);
  final CharSequence title=getString(R.string.title_search_query,mQuery);
  getActivityHelper().setActionBarTitle(title);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mTabHost.setup();
  setupSessionsTab();
  setupVendorsTab();
}
 

Example 63

From project iosched_2, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SearchActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  mQuery=intent.getStringExtra(SearchManager.QUERY);
  setContentView(R.layout.activity_search);
  getActivityHelper().setupActionBar(getTitle(),0);
  final CharSequence title=getString(R.string.title_search_query,mQuery);
  getActivityHelper().setActionBarTitle(title);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabWidget=(TabWidget)findViewById(android.R.id.tabs);
  mTabHost.setup();
  setupSessionsTab();
  setupVendorsTab();
}
 

Example 64

From project iosched_3, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SessionLivestreamActivity.java

  19 
vote

public TabsAdapter(FragmentActivity activity,TabHost tabHost,ViewPager pager){
  super(activity.getSupportFragmentManager());
  mContext=activity;
  mTabHost=tabHost;
  mViewPager=pager;
  mTabHost.setOnTabChangedListener(this);
  mViewPager.setAdapter(this);
  mViewPager.setOnPageChangeListener(this);
  mFragments=new SparseArray<Fragment>(3);
  mTabNums=new ArrayList<Integer>(3);
}
 

Example 65

From project MIT-Mobile-for-Android, under directory /src/edu/mit/mitmobile2/classes/.

Source file: CourseDetailsView.java

  19 
vote

@Override public View getView(){
  LayoutInflater vi=(LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mView=(LockingScrollView)vi.inflate(R.layout.courses_details,null);
  mLoader=(FullScreenLoader)mView.findViewById(R.id.coursesDetailsLoader);
  updateHeader(mCourseItem);
  tabHost=(TabHost)mView.findViewById(R.id.coursesDetailsTH);
  tabHost.setup();
  TabConfigurator tabConfigurator=new TabConfigurator(mActivity,tabHost);
  tabConfigurator.addTab("News",R.id.tabNews);
  tabConfigurator.addTab("Info",R.id.tabInfo);
  tabConfigurator.addTab("Staff",R.id.tabStaff);
  tabConfigurator.configureTabs();
  return mView;
}
 

Example 66

From project ohmagePhone, under directory /src/org/ohmage/activity/.

Source file: HelpActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.tab_layout);
  setActionBarShadowVisibility(false);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mViewPager=(ViewPager)findViewById(R.id.pager);
  mTabsAdapter=new TabsAdapter(this,mTabHost,mViewPager);
  mTabsAdapter.addTab(getString(R.string.help_goto_dashboard),DashboardWebViewFragment.class,null);
  mTabsAdapter.addTab(getString(R.string.help_goto_filter),FilterWebViewFragment.class,WebViewFragment.instanceBundle(URLS[0]));
  mTabsAdapter.addTab(getString(R.string.help_goto_list),WebViewFragment.class,WebViewFragment.instanceBundle(URLS[1]));
  if (savedInstanceState != null) {
    mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
  }
}
 

Example 67

From project Ohmage_Phone, under directory /src/org/ohmage/activity/.

Source file: ResponseHistoryActivity.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.response_history_layout);
  mTimeFilter=(DateFilterControl)findViewById(R.id.date_filter);
  mTimeFilter.setMonth(getIntent().getIntExtra(TimeFilter.EXTRA_MONTH,-1),getIntent().getIntExtra(TimeFilter.EXTRA_YEAR,-1));
  mTimeFilter.setOnChangeListener(new DateFilterControl.DateFilterChangeListener(){
    @Override public void onFilterChanged(    Calendar curValue){
      Log.d(TAG,"calendar changed");
      ((TimeFilterable)mTabManager.getCurrentTab().getFragment()).setMonth(curValue.get(Calendar.MONTH),curValue.get(Calendar.YEAR));
    }
  }
);
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTabManager=new TabManager(this,mTabHost,R.id.realtabcontent);
  mTabManager.setOnTabChangedListener(new TabManager.TabChangedListener(){
    @Override public void onTabChanged(    String tabId){
      ((CampaignFilterable)mTabManager.getCurrentTab().getFragment()).setCampaignUrn(getCampaignUrn());
      ((SurveyFilterable)mTabManager.getCurrentTab().getFragment()).setSurveyId(getSurveyId());
      ((TimeFilterable)mTabManager.getCurrentTab().getFragment()).setMonth(getCurrentMonth(),getCurrentYear());
      mTimeFilter.setCalendarUnit(Calendar.MONTH);
    }
  }
);
  Bundle calendarBundle=intentToFragmentArguments(getIntent());
  calendarBundle.remove(TimeFilter.EXTRA_DAY);
  mTabManager.addTab(mTabHost.newTabSpec("calendar").setIndicator(createTabView("Calendar")),ResponseHistoryCalendarFragment.class,calendarBundle);
  mTabManager.addTab(mTabHost.newTabSpec("map").setIndicator(createTabView("Map")),ResponseMapFragment.class,intentToFragmentArguments(getIntent()));
  if (savedInstanceState != null) {
    mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
  }
}
 

Example 68

From project PennMeet, under directory /src/com/pennapps/pennmeet/.

Source file: GroupsActivity.java

  19 
vote

public void setupTabs(){
  Resources res=getResources();
  tabHost=getTabHost();
  TabHost.TabSpec spec;
  tabHost.setup();
  spec=tabHost.newTabSpec("member").setIndicator("Member",res.getDrawable(R.drawable.group_bw)).setContent(R.id.groups_tab_one);
  tabHost.addTab(spec);
  spec=tabHost.newTabSpec("administrator").setIndicator("Admin",res.getDrawable(R.drawable.administrator)).setContent(R.id.groups_tab_two);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
  TabWidget tw=getTabWidget();
  for (int i=0; i < tw.getChildCount(); i++) {
    TextView text=(TextView)tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title);
    text.setTextColor(Color.WHITE);
  }
}
 

Example 69

From project Pixelesque, under directory /src/de/devmil/common/ui/color/.

Source file: ColorSelectorView.java

  19 
vote

private void init(){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View contentView=inflater.inflate(R.layout.color_colorselectview,null);
  addView(contentView,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
  hsvSelector=new HsvSelectorView(getContext());
  hsvSelector.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
  hsvSelector.setOnColorChangedListener(new HsvSelectorView.OnColorChangedListener(){
    @Override public void colorChanged(    int color){
      setColor(color);
    }
  }
);
  rgbSelector=new RgbSelectorView(getContext());
  rgbSelector.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
  rgbSelector.setOnColorChangedListener(new RgbSelectorView.OnColorChangedListener(){
    @Override public void colorChanged(    int color){
      setColor(color);
    }
  }
);
  hexSelector=new HexSelectorView(getContext());
  hexSelector.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
  hexSelector.setOnColorChangedListener(new HexSelectorView.OnColorChangedListener(){
    @Override public void colorChanged(    int color){
      setColor(color);
    }
  }
);
  tabs=(TabHost)contentView.findViewById(R.id.colorview_tabColors);
  tabs.setup();
  ColorTabContentFactory factory=new ColorTabContentFactory();
  TabSpec hsvTab=tabs.newTabSpec(HSV_TAG).setIndicator("HSV",getContext().getResources().getDrawable(R.drawable.hsv32)).setContent(factory);
  TabSpec rgbTab=tabs.newTabSpec(RGB_TAG).setIndicator("RGB",getContext().getResources().getDrawable(R.drawable.rgb32)).setContent(factory);
  TabSpec hexTab=tabs.newTabSpec(HEX_TAG).setIndicator("HEX",getContext().getResources().getDrawable(R.drawable.hex32)).setContent(factory);
  tabs.addTab(hsvTab);
  tabs.addTab(rgbTab);
  tabs.addTab(hexTab);
}
 

Example 70

From project platform_packages_apps_settings, under directory /src/com/android/settings/.

Source file: TrustedCredentialsSettings.java

  19 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup parent,Bundle savedInstanceState){
  mTabHost=(TabHost)inflater.inflate(R.layout.trusted_credentials,parent,false);
  mTabHost.setup();
  addTab(Tab.SYSTEM);
  addTab(Tab.USER);
  return mTabHost;
}
 

Example 71

From project Primum-Android, under directory /src/main/java/com/primum/mobile/activity/.

Source file: ConfigActivity.java

  19 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.config);
  Resources res=getResources();
  tabHost=getTabHost();
  TabHost.TabSpec spec;
  spec=tabHost.newTabSpec("device").setIndicator(getString(R.string.device),res.getDrawable(android.R.drawable.ic_menu_manage)).setContent(DeviceConfigActivity_.intent(this).get());
  tabHost.addTab(spec);
  spec=tabHost.newTabSpec("user").setIndicator(getString(R.string.patient),res.getDrawable(android.R.drawable.ic_menu_set_as)).setContent(PatientConfigActivity_.intent(this).get());
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
}
 

Example 72

From project SVQCOM, under directory /Core/src/com/ushahidi/android/app/.

Source file: IncidentTab.java

  19 
vote

public static void setTabColor(TabHost tabhost,int selectedColor,int unselectedColor){
  for (int i=0; i < tabhost.getTabWidget().getChildCount(); i++) {
    tabhost.getTabWidget().getChildAt(i).setBackgroundColor(unselectedColor);
    TextView tv=(TextView)tabhost.getTabWidget().getChildAt(i).findViewById(android.R.id.title);
    tv.setTextColor(Color.parseColor("#ffffff"));
  }
  tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(selectedColor);
  TextView tv=(TextView)tabhost.getCurrentTabView().findViewById(android.R.id.title);
  tv.setTextColor(Color.parseColor("#ffffff"));
}
 

Example 73

From project TransportsRennes, under directory /TransportsCommun/src/fr/ybo/transportscommun/activity/commun/.

Source file: BaseActivity.java

  19 
vote

protected void configureTabs(){
  mTabHost=(TabHost)findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mViewPager=(ViewPager)findViewById(R.id.pager);
  mTabsAdapter=new TabsAdapter(this,mTabHost,mViewPager);
}
 

Example 74

From project UABDroid, under directory /src/android/support/v4/app/.

Source file: TabManager.java

  19 
vote

public TabManager(FragmentActivity activity,TabHost tabHost,int containerId){
  mActivity=activity;
  mTabHost=tabHost;
  mContainerId=containerId;
  mTabHost.setOnTabChangedListener(this);
}
 

Example 75

From project warda, under directory /src/app/warda/.

Source file: AwesomeActivity.java

  19 
vote

private void addTab(String labelId,int drawableId,Class<?> c){
  Intent intent=new Intent(this,c);
  TabHost.TabSpec spec=tabHost.newTabSpec("tab" + labelId);
  View tabIndicator=LayoutInflater.from(this).inflate(R.layout.tab_indicator,getTabWidget(),false);
  TextView title=(TextView)tabIndicator.findViewById(R.id.title);
  title.setText(labelId);
  ImageView icon=(ImageView)tabIndicator.findViewById(R.id.icon);
  icon.setImageResource(drawableId);
  spec.setIndicator(tabIndicator);
  spec.setContent(intent);
  tabHost.addTab(spec);
}