[android-beginners] Re: custom component in a list

2008-07-11 Thread Sylvester Steele
I don't know how you have created your Adapter for supplying to your ListView subclass. I am assuming that you implemented an Adapter subclass that overrode getView() and is returning your row objects on demand, perhaps instantiated via ViewInflate. arrayAdapter1= new ArrayAdapter String(this,

[android-beginners] Re: custom component in a list

2008-07-11 Thread Mark Murphy
Sylvester Steele wrote: arrayAdapter1= new ArrayAdapter String(this, R.layout.component, R.id.name); is how I initialize my adapter. I do not override any methods. component is my custom component and name is a textView that takes the value. That may make things more complicated for

[android-beginners] Re: custom component in a list

2008-07-11 Thread Sylvester Steele
Mark, a couple of questions: 1. I looked at the getView funtcion:ViewgetView(int position, View convertView, ViewGroup parent). I can understand that position refers to the particular element on the list and ViewGroup parent to the custom view I am using for the list items. But what

[android-beginners] Re: custom component in a list

2008-07-11 Thread Mark Murphy
1. I looked at the getView funtcion: ViewgetView(int position, View convertView, ViewGroup parent). I can understand that position refers to the particular element on the list and ViewGroup parent to the custom view I am using for the list items. But what does View

[android-beginners] Re: custom component in a list

2008-07-10 Thread Sylvester Steele
It is unclear who this is in this.findViewById(R.id.dButton). referred to the activity in the above post. But changed it now to: deleteButton1= (Button)customComponent.findViewById(R.id.deleteButton); customComponent is initialized as: customComponent= new ConversationListView(this);

[android-beginners] Re: custom component in a list

2008-07-10 Thread Mark Murphy
It is unclear who this is in this.findViewById(R.id.dButton). referred to the activity in the above post. But changed it now to: deleteButton1= (Button)customComponent.findViewById(R.id.deleteButton); customComponent is initialized as: customComponent= new ConversationListView(this);

[android-beginners] Re: custom component in a list

2008-07-09 Thread Sylvester Steele
dButton= (Button)this.findViewById(R.id.dButton); is I think where it problem is. I played around a bit with it and realized that other functions were also throwing up an exception. Then I just created a new button, using new Button(this); and it worked fine. So, why is dButton=

[android-beginners] Re: custom component in a list

2008-07-09 Thread Mark Murphy
Sylvester Steele wrote: dButton= (Button)this.findViewById(R.id.dButton); is I think where it problem is. I played around a bit with it and realized that other functions were also throwing up an exception. Then I just created a new button, using new Button(this); and it worked fine. So,

[android-beginners] Re: custom component in a list

2008-07-08 Thread Romain Guy
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