Hello Kostya, Thanks for the reply.
On Thu, Jan 5, 2012 at 11:39 AM, Kostya Vasilyev <kmans...@gmail.com> wrote: > > 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. Ok. I think I am doing what you say. > > 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. The listview is created using that id. I did not create any resources for the individual items. I don't know how to do that. The example code I used simply created a listview in xml. > > 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. Super. I am glad you confimed I need ot do that. However, as I said, I don't know what would be the id of the row items since they are not defined. > > -- Kostya > > 5 января 2012 г. 20:31 пользователь John Davis <davi...@gmail.com> написал: >> >> 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 android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> 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 android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en