Tab widget and activity

by ryla...@gmail.com » Thu, 12 Mar 2009 01:24:43 GMT


Sponsored Links
 I am trying to have both a tab widget and another activity running at
the same time. I am trying to start the second activity from the same
oncreate method as the tab widget;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mTabHost = getTabHost();

    mTabHost.addTab(mTabHost.newTabSpec("one").setIndicator
("one").setContent(R.id.textview1));
    mTabHost.addTab(mTabHost.newTabSpec("two").setIndicator
("two").setContent(R.id.textview2));
    mTabHost.addTab(mTabHost.newTabSpec("three").setIndicator
("three").setContent(R.id.textview3));

    mTabHost.setCurrentTab(0);

    Intent i = new Intent(Test.this, TestThing.class);

}

This only stops the tab widget from being shown(if i understand
correctly it would need a pause/ interrupt to show the tab activity),
I would however like it to work with these 2 running together.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. ZssWhy do I get "XmlPullParserException: attr value delimiter missing!" when use XmlPullParser to parse page in Android



It depends on the parser. Your xml might not be a well-formed one.
There are some parsers which can parse strict xml format. You need to
check that.

Thanks and Regards,
Kumar Bibek





-- 

2. Background images to fit different screens



You could:

-- rename your res/drawable-mdpi/ folder to res/drawable/, therefore
making it the default

-- clone your res/drawable-mdpi/ folder to res/drawable-mdpi-v3/, which
was a workaround for some resource limitations with 1.5 that were
covered in a Google I|O 2010 presentation

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 

3. Background images to fit different screens

4. Market stats not updated since three days

5. Market behaving strangely today

6. Theme.Translucent.NoTitleBar.Fullscreen and fullscreen?

7. How to access and change settings for the phone and email accounts