Android/Java Beginner: Overriding ArrayAdapter's getView
- by Preformed Cone
Firstly I am new to android and Java so this is a beginners question.
I have some code that overrides the ArrayAdapter's getView method. Here is the code
public View getView(int position, View convertView, ViewGroup parent) {
TextView label = (TextView)convertView;
if (convertView == null) {
convertView = new TextView(ctxt);
label = (TextView)convertView;
}
label.setText(items[position]);
return (convertView);
}
My question is: why does label.setText(items[position]); affect the convertView return value? How are they related / linked?