I'm trying to write a own std Telephoneapp with Phonebook, Dialpad etc. using SIP ... but this part is not the problem.
I have the problem with TabHost as my Launcher and the Activitys running in it.
Main code looks something like this:
Using java Syntax Highlighting
- public class test extends TabActivity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- ...
- final TabHost tabHost = getTabHost();
- tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("", getRes....)
- .setContent(new Intent(this, Dialpad.class)));
- tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("", getRes....)
- .setContent(new Intent(this, Phonebook.class)))
- ...
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
It's working fine I can switch Tabs an work within the classes/activities as intended etc. Now I want to switch from tab2 to tab1 when one of the phonebook entries is selected. In a further step I want to pass the the phone number to the Activity running in "tab1". So here are the my questions ^^
How can I switch the Tabs when a button in one of the Activities is pressed. (Note: tabHost.setCurrentTab() does not work cause I can't retrieve tabHost within those Activities - at least not yet)
And how can pass data - lets say an integer - from one Activity to another. I'm a little confused with those Intents, BroadcastReceifer etc. so some clarification on this two questions would be nice.
Thanks in ragards, Tol


