Better just use your own explicit integer values in both the code and layout resource.
On Mon, Sep 27, 2010 at 3:40 PM, Mark Murphy <[email protected]>wrote: > On Mon, Sep 27, 2010 at 12:53 PM, greenset <[email protected]> > wrote: > > I have an xml layout that will display a grid made up of textviews > > within tablerows. The textview names are cell00, cell01, etc. At > > runtime, my program will determine which cell needs to be changed. > > > > Is there a way get format a name so that it can be passed to the > > findViewById method at runtime? > > Use getResources().getIdentifier(), but please be sure to cache the > results, since they are discovered via reflection and are relatively > expensive to look up. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > Android Training in London: http://skillsmatter.com/go/os-mobile-server > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] 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 [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

