The id you pass to the constructor of the ArrayAdapter is the id of
the XML layout to inflate. This means you have to use something like
R.layout.my_layout. If you do not want to use XML (and you should
because it's more flexible as it can adapt to various configurations,
languages, etc.) you will have to create your own adapter and override
the getView() method. With some adapters, like SimpleCursorAdapter,
you can also supply a ViewBinder.

On Mon, Jul 7, 2008 at 11:39 PM, Sylvester Steele
<[EMAIL PROTECTED]> wrote:
>
> I have a custom component with a texttView and a button. I want to
> display this in a simple list.
>
> customComponent = new conversationListView (this, "blah");
>        arrayAdapter1= new ArrayAdapter <String>(this,
> customComponent.getId(), customComponent.textView.getId());
>
>
> I get an error saying some resourceID is 0xff(more fs).I think the
> array adapter initialization is causing this. I am creating a new
> custom component and not using XML. Could this be the reason? If it
> is, how do I make it work without using an XML layout? Also, is the
> "customComponent.textView.getId()" parameter the correct way to access
> the textView?
>
> Thanks,
> Sylvester
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to