[android-developers] Re: Is there (or should there be), a generateId() method for dynamically generated Views?

2010-10-17 Thread Kevin Kovach
What about situations where you need the id of a dynamically created
view for use in LayoutParams?  Say I want to position a new view to
the right of a previously created view in a relative layout?  How do
you get a hold of those views if you have only used setTag() or
nothing at all?  Thanks.

- Kevin

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


Re: [android-developers] Re: Is there (or should there be), a generateId() method for dynamically generated Views?

2010-10-17 Thread Dianne Hackborn
On Mon, Aug 30, 2010 at 12:11 PM, Anil anil.r...@gmail.com wrote:

 Because it could potentially clash with the automatically generated
 ids. (Unless I am missing something).


Resource IDs are always = 0x0100.

-- 
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: Is there (or should there be), a generateId() method for dynamically generated Views?

2010-08-30 Thread Bret Foreman
Is there a way to make a ListView mutually exclusive like a RadioGroup
so that selecting one item deselects the others?


 IMHO, if you are concerned about the number of radio buttons, you
 should be using a ListView.

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

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

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


Re: [android-developers] Re: Is there (or should there be), a generateId() method for dynamically generated Views?

2010-08-30 Thread Mark Murphy
On Mon, Aug 30, 2010 at 11:47 AM, Bret Foreman bret.fore...@gmail.com wrote:
 Is there a way to make a ListView mutually exclusive like a RadioGroup
 so that selecting one item deselects the others?

android:choiceMode=single and a row layout that is a CheckedTextView works.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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: Is there (or should there be), a generateId() method for dynamically generated Views?

2010-08-30 Thread Anil
Because it could potentially clash with the automatically generated
ids. (Unless I am missing something).
On Aug 30, 10:45 am, Mark Murphy mmur...@commonsware.com wrote:

 Why not radioButtonId++?

-- 
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: Is there (or should there be), a generateId() method for dynamically generated Views?

2010-08-30 Thread Anil
ok, I did not know that.

On Aug 30, 10:54 am, Kostya Vasilyev kmans...@gmail.com wrote:
   It's also not quite correct that a radio button is only identified by
 its viewId.

 Using View.setTag (two versions), you can associate your own data item
 (s) with a view.

 However, I agree with Mark that using a ListView is quite likely to be a
 better solution.

-- 
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: Is there (or should there be), a generateId() method for dynamically generated Views?

2010-08-30 Thread Mike dg
Yes,

Look into the ListView with setChoiceMode(CHOICE_MODE_SINGLE)

-Mike DG

On Aug 30, 11:47 am, Bret Foreman bret.fore...@gmail.com wrote:
 Is there a way to make a ListView mutually exclusive like a RadioGroup
 so that selecting one item deselects the others?









  IMHO, if you are concerned about the number of radio buttons, you
  should be using a ListView.

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

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

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