Hi,

I am adding a list in tab host like this and its working fine.


public class Main extends TabActivity {

        @Override
        public void onCreate(Bundle savedInstanceState) {

                super.onCreate(savedInstanceState);
                {
                         TabHost tabHost = getTabHost();

                        tabHost.setHorizontalScrollBarEnabled(true);

                        tab = tabHost.newTabSpec("Dial a Number");
                        tab.setContent(new Intent(this, Dialer.class));
                        tab.setIndicator("Dialer", getResources().getDrawable
(R.drawable.dialer_tab_icon));
                        tabHost.addTab(tab);

        }
      }

In this class Dialer is my list activity and i am showing contacts
with phone numbers in this list.
but you will add both your activities in menifest file
hopes it will help you.

Regards,
Gulfam Hassan
On Aug 5, 2:14 pm, Dany BREARD <[email protected]> wrote:
> Hi
>
> you can go to this url
>
> http://www.anddev.org/viewtopic.php?p=25173#25173
>
> I think you have to replace: @+id/list  to �...@android:id/list
>
> help me please
>
> about my issu on the preview url
>
> thanks
>
> Dayn
>
> On Jul 31, 5:22 am, Jack Ha <[email protected]> wrote:
>
> > Can you post your logcat output with the stack trace?
>
> > --
> > Jack Ha
> > Open Source Development Center
> > ・T・ ・ ・Mobile・ stick together
>
> > The views, opinions and statements in this email are those of
> > the author solely in their individual capacity, and do not
> > necessarily represent those of T-Mobile USA, Inc.
>
> > On Jul 29, 5:42 pm, Holden Karau <[email protected]> wrote:
>
> > > I'm trying to figure out how to emebed a listview in a tabhost
> > > Whenever I call
>
> > > l1 = (ListView) findViewById(R.id.list);
> > > l1.setAdapter(new ArrayAdapter<String>
> > > (this,android.R.layout.simple_list_item_1, SITES));
>
> > > it dies a rather unglamorouis death.
> > > List is defined as
> > > <ListView
> > >      android:id="@+id/list"
> > >      android:layout_width="wrap_content"
> > >      android:layout_height="wrap_content"/>
>
> > > I suspect I'm missing something rather obvious as I'm just getting
> > > started with this, but I couldn't find other examples of people having
> > > listviews inside tabcontrols besides the one which suggested as above.
> > > Any suggestions?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to