Hello Mike,

I'm not familiar with the code you are using, but I believe you want
to use setSelection() inside the "onCreate" method of the activity,
something like:

findViewById(R.id.myListView).setSelection(0);

See here for more info:
http://developer.android.com/reference/android/widget/ListView.html#setSelection%28int%29

If you're still struggling, post up the activity code so we can better
see what it is you are trying to do.


Regards,

Sean


On Mon, Jun 1, 2009 at 10:19 AM, MMC2 <[email protected]> wrote:
>
> I am writing an app that is partly based on the ToDo Item example in
> the book "Professional Android Application Development by Reto Meier.
> I have an array list that lists data stored in a database. What I
> would like, is to be able to set the focus automatically to the first
> item by code when the list loads. The way things are at present, if I
> try to remove an item without manually highlighting it first, I get an
> error. Help please?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to