[android-developers] Re: can ListActivity and Tab widget can use in one activity?

2009-08-10 Thread Anderson Franco


 You don't need to use ListActivity; just put a ListView in your layout and
 work with it directly.

Ok, I know that. And how can I set a ListAdapter to this view since I
am not extending ListActivity ?

Anderson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: can ListActivity and Tab widget can use in one activity?

2009-08-10 Thread Jack Ha


listview.setAdapter(new MyListAdapter(this));

--
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 Aug 10, 4:13 pm, Anderson Franco bit...@gmail.com wrote:
  You don't need to use ListActivity; just put a ListView in your layout and
  work with it directly.

 Ok, I know that. And how can I set a ListAdapter to this view since I
 am not extending ListActivity ?

 Anderson
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: can ListActivity and Tab widget can use in one activity?

2009-08-10 Thread Anderson Franco

Jack, thanks in advance.

How should I declare listview ?
See the code below. It works fine if I'm extending a ListActivity.
Like this:

// ListActivity works
// --
public class FormGrid extends ListActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.grid);

ArrayListString List = new ArrayListString();

List.add(row 1);
List.add(row 2);

setListAdapter(new ArrayAdapterString(this,
android.R.layout.simple_list_item_1, List));
}
}


But I would like to have both ListView and TabHost in the same
activity. So I'm trying thi way:

// ListActivity doesn't work
// -
public class FormGrid extends TabActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.grid);

ListView lv = new ListView(this);
ArrayListString List = new ArrayListString();

List.add(row 1);
List.add(row 2);

lv.setAdapter(new ArrayAdapterString(this,
android.R.layout.simple_list_item_1, List));
}
}

LinearLayout
xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/LinearLayout
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=vertical
ListView
android:id=@android:id/list
android:layout_width=wrap_content
android:layout_height=wrap_content
/ListView
/LinearLayout


On 10 ago, 21:09, Jack Ha jack...@t-mobile.com wrote:
     listview.setAdapter(new MyListAdapter(this));

 --
 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 Aug 10, 4:13 pm, Anderson Franco bit...@gmail.com wrote:

   You don't need to use ListActivity; just put a ListView in your layout and
   work with it directly.

  Ok, I know that. And how can I set a ListAdapter to this view since I
  am not extending ListActivity ?

  Anderson


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: can ListActivity and Tab widget can use in one activity?

2009-08-09 Thread Jack Ha

Not sure what you mean one is on the left side and the other is on the
right side. Are you thinking about having the List widget as the
content of one of the tabs like the Contacts app?

--
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 Aug 9, 6:38 pm, tstanly tsai.sta...@gmail.com wrote:
 hi all,

 my activity have to use List and Tab widget,
 one is left side,the other is right side, I means layout,

 but use List must to extends ListActivity,
 and use Tab widget must to extends TabActivity?

 is it possible??

 thanks!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: can ListActivity and Tab widget can use in one activity?

2009-08-09 Thread Dianne Hackborn
You don't need to use ListActivity; just put a ListView in your layout and
work with it directly.

On Sun, Aug 9, 2009 at 6:38 PM, tstanly tsai.sta...@gmail.com wrote:


 hi all,

 my activity have to use List and Tab widget,
 one is left side,the other is right side, I means layout,

 but use List must to extends ListActivity,
 and use Tab widget must to extends TabActivity?


 is it possible??

 thanks!!
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: can ListActivity and Tab widget can use in one activity?

2009-08-09 Thread tstanly

sorry, I was ignore about that...


thanks anyway

On 8月10日, 上午11時12分, Dianne Hackborn hack...@android.com wrote:
 You don't need to use ListActivity; just put a ListView in your layout and
 work with it directly.





 On Sun, Aug 9, 2009 at 6:38 PM, tstanly tsai.sta...@gmail.com wrote:

  hi all,

  my activity have to use List and Tab widget,
  one is left side,the other is right side, I means layout,

  but use List must to extends ListActivity,
  and use Tab widget must to extends TabActivity?

  is it possible??

  thanks!!

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.- 隱藏被引用文字 -

 - 顯示被引用文字 -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---