add Tab To TabHost - Android User Interface

Android examples for User Interface:TabHost

Description

add Tab To TabHost

Demo Code

/*/*from  w ww. j av  a2 s.c  om*/
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE.txt', which is part of this source code package.
 */
//package com.java2s;

import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class Main {
    public static void addTabToTabHost(TabHost host, String label,
            int content) {

        TabSpec spec = host.newTabSpec(label);
        spec.setIndicator(label);
        spec.setContent(content);
        host.addTab(spec);

    }
}

Related Tutorials