1:

http://developer.android.com/reference/android/widget/Adapter.html#getView(int,
android.view.View, android.view.ViewGroup)

2:

Yes, you're supposed to call the base class in your case, the ArrayAdapter
will be doing most of the work for you, inflating new or reusing existing
row layouts.

3:

Use view ids that are relevant to (used inside) your actual row item layout.

I very much doubt that R.id.listView1 is it.

4:

view.findViewById() is the getChild call you're looking for, using an id to
locate the view. Use correct id value and it should work.

-- Kostya

5 января 2012 г. 20:31 пользователь John Davis <[email protected]> написал:

> 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

-- 
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

Reply via email to