I have Tab host contains Three tabs "STEP 1,STEP 2,and STEP 3". Main Tab Host
Activity "MainActiveTab
" is Parent activity ,child Activity "TabActStep_1
,TabActStep_2
,TabActStep_3
" resp.
I Want to access on EditText
and Other Value from child Tab Activity like "TabActStep_1,TabActStep_2,TabActStep_3
" .
//Assign id to Tabhost.
TabHostWindow = (TabHost) findViewById(android.R.id.tabhost);
//Creating tab menu.
TabHost.TabSpec TabMenu1 = TabHostWindow.newTabSpec("First tab");
TabHost.TabSpec TabMenu2 = TabHostWindow.newTabSpec("Second Tab");
TabHost.TabSpec TabMenu3 = TabHostWindow.newTabSpec("Third Tab");
//Setting up tab 1 name.
TabMenu1.setIndicator("STEP 1");
//Set tab 1 activity to tab 1 menu.
TabMenu1.setContent(new Intent(this, TabActStep_1.class));
//Setting up tab 2 name.
TabMenu2.setIndicator("STEP 2");
//Set tab 3 activity to tab 1 menu.
TabMenu2.setContent(new Intent(this, TabActStep_2.class));
//Setting up tab 2 name.
TabMenu3.setIndicator("STEP 3");
//Set tab 3 activity to tab 3 menu.
TabMenu3.setContent(new Intent(this, TabActStep_3.class));
//Adding tab1, tab2, tab3 to tabhost view.
TabHostWindow.addTab(TabMenu1);
TabHostWindow.addTab(TabMenu2);
TabHostWindow.addTab(TabMenu3);
This is "MainActiveTab
" Here I Want To Get Child Tab Activity Values EditText
. etc
Am Try to Send Value from Child Tab Like This
Intent intent = new Intent(getApplicationContext(), MainActiveTab.class);
// Intent intent = new Intent(getApplicationContext(),MainActiveTab.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("name","tab");
// intent.putExtra("HouseName", strHouseName);
startActivity(intent);
This passing Value Get From Main Tab in MainActiveTab
Using This Code Using Here
Bundle bundle = getIntent().getExtras();
String id=bundle.get("name").toString();
Declaring intent function on child Tab the that Tab is Showing "Unfortunately App Has Stopped" I Hope You Can Help Me.Thank You !!!