HiHo!

On Mon, 2009-12-14 at 09:18 -0800, Romain Guy wrote:
> Hi,
> 
> It looks like you are doing the wrong thing in your adapter. Are you
> locally caching views yourself?

AFAIK, no, I am not.

I just do very simple stuff using the available APIs without touching
fancy stuff like caching.

The adapter is ArrayAdapter. The array is a String array. I only
override the following two functions of ListActivity:

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        setListAdapter(new ArrayAdapter(this,
                                        R.layout.todo_list_row,
                                        new String[] {
                                                "Phobos",
                                                "Demos",
                                                "Venus",
                                                "Pluto",
                                                "Mercury"
                                        }));
    }

    @Override
    protected void onListItemClick(ListView l,
                                   View v, int position, long id) {

            super.onListItemClick(l, v, position, id);

            v.setBackgroundResource(R.color.todo_item_highlighted);
    }

The todo_list_row.xml is just:

<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView
    xmlns:android="http://schemas.android.com/apk/res/android";
    android:id="@+id/RowId"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"></CheckedTextView>

> -- 
> Romain Guy
> Android framework engineer
> [email protected]
> 
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them

-- 
Best regards,
Eus (FSF member #4445)

In this digital era, where computing technology is pervasive, your
freedom depends on the software controlling those computing devices.

Join free software movement today! It is free as in freedom, not as in
free beer!

Join: http://www.fsf.org/jf?referrer=4445

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