Hello
The getView() call for arrayadapter is blank. Is there a document
which describes how it works?
I have overridden it in order to change the text color of items in a
list view. So far, I can't find any code which works.
I've tried this:
public class MyAdapter<T> extends ArrayAdapter<T> {
public MyAdapter(Context context, int textViewResourceId, T[] objects) {
super(context, textViewResourceId, objects);
}
// context, int, <T>[]
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View row;
row = super.getView(position, convertView, parent);
TextView text;
text = (TextView) row.findViewById(R.id.listView1);
text.setTextColor(0x64788e);
return row;
}
}
I don't know if I am supposed to call getView in the main code or not,
but this will most certain crash the app.
The super.getView call seems to get a row in the list. It seems that
you then need to get the view associated with that row. I have no
idea how to do that. I don't have resource id's for the individual row
items. Here, I tried to use the resource id of the list itself.
There is not a View.getChild() like call.
--
John F. Davis
独树一帜
--
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