01.
protected
void
onCreate(Bundle savedInstanceState) {
02.
03.
04.
05.
06.
super
.onCreate(savedInstanceState);
07.
setContentView(R.layout.tabmanu);
08.
09.
10.
Intent inboundIntent = getIntent();
11.
String user_name = inboundIntent.getExtras().getString(
"username"
);
12.
String n = user_name;
13.
Log.d(
"userTab"
,n);
14.
15.
Resources res = getResources();
16.
TabHost tabHost =
this
.getTabHost();
17.
TabHost.TabSpec spec;
18.
Intent intent;
19.
20.
intent =
new
Intent().setClass(
this
.getApplicationContext(), Income.
class
);
21.
Bundle bundle =
new
Bundle();
22.
bundle.putString(
"username"
, n);
23.
intent.putExtras(bundle);
24.
spec = tabHost.newTabSpec(
"Income"
).setIndicator(
"income"
).setContent(intent);
25.
tabHost.addTab(spec);
26.
27.
intent =
new
Intent().setClass(
this
.getApplicationContext(), Expense.
class
);
28.
Bundle eBundle =
new
Bundle();
29.
eBundle.putString(
"username"
, n);
30.
intent.putExtras(eBundle);
31.
spec = tabHost.newTabSpec(
"Expense"
).setIndicator(
"expense"
,res.getDrawable(R.drawable.expense))
32.
.setContent(intent);
33.
tabHost.addTab(spec);
34.
35.
intent =
new
Intent().setClass(
this
.getApplicationContext(), Reports.
class
);
36.
spec = tabHost.newTabSpec(
"REPORT"
).setIndicator(
"report"
).setContent(intent);
37.
tabHost.addTab(spec);
38.
39.
}
40.
41.
}