Tab Menu (Android)

package TabMenu.aerdy;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TabHost;

public class TabMenuActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
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);
tabs.setCurrentTab(0);

}
}

Download project di Sini

Advertisements

Published by

jarcode

hello I am jarcode

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s