package com.tabs; import android.app.TabActivity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.widget.TabHost; import android.widget.TabHost.TabSpec; @SuppressWarnings({ "unused", "deprecation" }) public class MainActivity extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost); Resources res = getResources(); TabHost th = getTabHost(); Intent tb1 = new Intent().setClass(this, New_User.class); TabSpec tbs1 = th.newTabSpec("New_user").setIndicator("NEW USER", null) .setContent(tb1); Intent tb2 = new Intent().setClass(this, Login_user.class); TabSpec tbs2 = th.newTabSpec("login").setIndicator("LOGIN", null) .setContent(tb2); th.addTab(tbs1); th.addTab(tbs2); th.setCurrentTab(0); } }
U
User 10297947
@User 10297947