[android-developers] Re: dynamically add checkbox

2009-08-11 Thread Jack Ha

You can create an empty LinearLayout and call its addView() function
to add the checkboxes dynamically in your code.

--
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 11, 5:44 am, Honest honestsucc...@gmail.com wrote:
 Hello,

 I want to create the checkbox dyananically and display them to the
 screen. My problem is that at compilation time i will not know that
 how many check boxes i will have to create. So can some one tell me
 how can i do it ?  I am so thankful to you as i have wasted already 2
 days behind this bloody issue.
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread Honest

Thanks Jack Ha for your reply. Can you give me code snippt to do it ?
Sorry but i am new bie in UI desing. I am just wasting my much time so
please tell me how can i do it.

On Aug 11, 8:54 pm, Jack Ha jack...@t-mobile.com wrote:
 You can create an empty LinearLayout and call its addView() function
 to add the checkboxes dynamically in your code.

 --
 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 11, 5:44 am, Honest honestsucc...@gmail.com wrote:



  Hello,

  I want to create the checkbox dyananically and display them to the
  screen. My problem is that at compilation time i will not know that
  how many check boxes i will have to create. So can some one tell me
  how can i do it ?  I am so thankful to you as i have wasted already 2
  days behind this bloody issue.
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread skink



On Aug 11, 4:54 pm, Jack Ha jack...@t-mobile.com wrote:
 You can create an empty LinearLayout and call its addView() function
 to add the checkboxes dynamically in your code.


if Honest doesn't know how many check boxes to add chanses are there
may be too many to fit them all in physical screen.

so maybe the better idea is to use ScrollView or ListView

pskink
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread Honest

Thanks pskink for you reply. But can you tell me how can i use
ListView or ScroolView. My basic requirement is that i want to display
more then one String and user should be able to select multiple item
from them. Please advice me and if possible give me code snippt. I am
doing this silly things from last two days. Sometimes easy things take
time.

On Aug 11, 10:58 pm, skink psk...@gmail.com wrote:
 On Aug 11, 4:54 pm, Jack Ha jack...@t-mobile.com wrote:

  You can create an empty LinearLayout and call its addView() function
  to add the checkboxes dynamically in your code.

 if Honest doesn't know how many check boxes to add chanses are there
 may be too many to fit them all in physical screen.

 so maybe the better idea is to use ScrollView or ListView

 pskink
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread skink



Honest wrote:
 Thanks pskink for you reply. But can you tell me how can i use
 ListView or ScroolView. My basic requirement is that i want to display
 more then one String and user should be able to select multiple item
 from them. Please advice me and if possible give me code snippt. I am
 doing this silly things from last two days. Sometimes easy things take
 time.

 On Aug 11, 10:58 pm, skink psk...@gmail.com wrote:
  On Aug 11, 4:54 pm, Jack Ha jack...@t-mobile.com wrote:
 
   You can create an empty LinearLayout and call its addView() function
   to add the checkboxes dynamically in your code.
 
  if Honest doesn't know how many check boxes to add chanses are there
  may be too many to fit them all in physical screen.
 
  so maybe the better idea is to use ScrollView or ListView
 
  pskink
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread skink



On Aug 11, 8:12 pm, Honest honestsucc...@gmail.com wrote:
 Thanks pskink for you reply. But can you tell me how can i use
 ListView or ScroolView. My basic requirement is that i want to display
 more then one String and user should be able to select multiple item
 from them. Please advice me and if possible give me code snippt. I am
 doing this silly things from last two days. Sometimes easy things take
 time.


well, add ScrollView in your layout file, inside it add empty
LinearLayout with some id

then in java obtain that LinearLayout by calling findViewById, cast it
to LinearLayout and finally call addView once or more times

pskink
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread John P.

This basically involves writing UI code programatically. See
http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/ScrollView2.html
for an example of adding multiple TextView and Button to a ScrollView
in a for loop.

On Aug 11, 2:12 pm, Honest honestsucc...@gmail.com wrote:
 Thanks pskink for you reply. But can you tell me how can i use
 ListView or ScroolView. My basic requirement is that i want to display
 more then one String and user should be able to select multiple item
 from them. Please advice me and if possible give me code snippt. I am
 doing this silly things from last two days. Sometimes easy things take
 time.

 On Aug 11, 10:58 pm, skink psk...@gmail.com wrote:



  On Aug 11, 4:54 pm, Jack Ha jack...@t-mobile.com wrote:

   You can create an empty LinearLayout and call its addView() function
   to add the checkboxes dynamically in your code.

  if Honest doesn't know how many check boxes to add chanses are there
  may be too many to fit them all in physical screen.

  so maybe the better idea is to use ScrollView or ListView

  pskink
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread Honest

Thanks i saw that example but now only one question in my mind. Can i
get the status of that checkbox letter ? if yes how. I am not finding
any assosiated ID with it so can some one tell me how can i do it ?

On Aug 12, 12:09 am, John P. johnny.d.p...@gmail.com wrote:
 This basically involves writing UI code programatically. 
 Seehttp://developer.android.com/guide/samples/ApiDemos/src/com/example/a...
 for an example of adding multiple TextView and Button to a ScrollView
 in a for loop.

 On Aug 11, 2:12 pm, Honest honestsucc...@gmail.com wrote:



  Thanks pskink for you reply. But can you tell me how can i use
  ListView or ScroolView. My basic requirement is that i want to display
  more then one String and user should be able to select multiple item
  from them. Please advice me and if possible give me code snippt. I am
  doing this silly things from last two days. Sometimes easy things take
  time.

  On Aug 11, 10:58 pm, skink psk...@gmail.com wrote:

   On Aug 11, 4:54 pm, Jack Ha jack...@t-mobile.com wrote:

You can create an empty LinearLayout and call its addView() function
to add the checkboxes dynamically in your code.

   if Honest doesn't know how many check boxes to add chanses are there
   may be too many to fit them all in physical screen.

   so maybe the better idea is to use ScrollView or ListView

   pskink
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread John P.

If I understand you correctly, you've progromatically added a checkbox
to a view.  In this case, you already have a handle to the object and
don't need to invoke findViewById().  If you didn't keep the handle
(say in a loop), then you can retrieve them again by going through
your listView -- either your own private or if you're using
ListActivity, invoke getListView().

Personally, if you wanted to keep track of the status of multiple
checkboxes, instead of going through the list everytime I'd keep a
separate list of booleans, or just a linked list of true's.

On Aug 11, 3:29 pm, Honest honestsucc...@gmail.com wrote:
 Thanks i saw that example but now only one question in my mind. Can i
 get the status of that checkbox letter ? if yes how. I am not finding
 any assosiated ID with it so can some one tell me how can i do it ?

 On Aug 12, 12:09 am, John P. johnny.d.p...@gmail.com wrote:



  This basically involves writing UI code programatically. 
  Seehttp://developer.android.com/guide/samples/ApiDemos/src/com/example/a...
  for an example of adding multiple TextView and Button to a ScrollView
  in a for loop.

  On Aug 11, 2:12 pm, Honest honestsucc...@gmail.com wrote:

   Thanks pskink for you reply. But can you tell me how can i use
   ListView or ScroolView. My basic requirement is that i want to display
   more then one String and user should be able to select multiple item
   from them. Please advice me and if possible give me code snippt. I am
   doing this silly things from last two days. Sometimes easy things take
   time.

   On Aug 11, 10:58 pm, skink psk...@gmail.com wrote:

On Aug 11, 4:54 pm, Jack Ha jack...@t-mobile.com wrote:

 You can create an empty LinearLayout and call its addView() function
 to add the checkboxes dynamically in your code.

if Honest doesn't know how many check boxes to add chanses are there
may be too many to fit them all in physical screen.

so maybe the better idea is to use ScrollView or ListView

pskink
--~--~-~--~~~---~--~~
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: dynamically add checkbox

2009-08-11 Thread Honest

Thanks john and all of you  for your continuous support. I want to add
some check boxes in screen and when user press menu or button then i
want to retrieve its status. So i think now you can understand what i
want and you can tell me how can i achieve this.

On Aug 12, 12:44 am, John P. johnny.d.p...@gmail.com wrote:
 If I understand you correctly, you've progromatically added a checkbox
 to a view.  In this case, you already have a handle to the object and
 don't need to invoke findViewById().  If you didn't keep the handle
 (say in a loop), then you can retrieve them again by going through
 your listView -- either your own private or if you're using
 ListActivity, invoke getListView().

 Personally, if you wanted to keep track of the status of multiple
 checkboxes, instead of going through the list everytime I'd keep a
 separate list of booleans, or just a linked list of true's.

 On Aug 11, 3:29 pm, Honest honestsucc...@gmail.com wrote:



  Thanks i saw that example but now only one question in my mind. Can i
  get the status of that checkbox letter ? if yes how. I am not finding
  any assosiated ID with it so can some one tell me how can i do it ?

  On Aug 12, 12:09 am, John P. johnny.d.p...@gmail.com wrote:

   This basically involves writing UI code programatically. 
   Seehttp://developer.android.com/guide/samples/ApiDemos/src/com/example/a...
   for an example of adding multiple TextView and Button to a ScrollView
   in a for loop.

   On Aug 11, 2:12 pm, Honest honestsucc...@gmail.com wrote:

Thanks pskink for you reply. But can you tell me how can i use
ListView or ScroolView. My basic requirement is that i want to display
more then one String and user should be able to select multiple item
from them. Please advice me and if possible give me code snippt. I am
doing this silly things from last two days. Sometimes easy things take
time.

On Aug 11, 10:58 pm, skink psk...@gmail.com wrote:

 On Aug 11, 4:54 pm, Jack Ha jack...@t-mobile.com wrote:

  You can create an empty LinearLayout and call its addView() function
  to add the checkboxes dynamically in your code.

 if Honest doesn't know how many check boxes to add chanses are there
 may be too many to fit them all in physical screen.

 so maybe the better idea is to use ScrollView or ListView

 pskink
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---