http://www.androidpeople.com/android-listview-example

A simple example. You are pretty close though :)

*Thanks and Regards,
Kumar Bibek*
*
http://techdroid.kbeanie.com
http://www.kbeanie.com*



On Mon, Jul 11, 2011 at 9:36 AM, Jim Graham <[email protected]> wrote:

> I'm trying to load a String[] array into a ListView.  Based on
> examples I've seen, I *THINK* this (below) is how to do it...but
> I'm far from certain.
>
> // This part I'm familiar with....
> String[] nameList = getResources().getStringArray(R.array.Grains_Names);
>
> // The rest of this is new ground for me
> gList = (ListView)findViewById(R.id.namelist);
> ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
> R.id.namelist);
>
> nameList.setAdapter(adapter);
> registerForContextMenu(nameList);
>
> Am I even close to getting this right?
>
> Thanks,
>   --jim
>
> --
> 73 DE N5IAL (/4)        | "Now what *you* need is a proper pint of
> [email protected]    | porter poured in a proper pewter porter
> < Running FreeBSD 7.0 > | pot.."
> ICBM / Hurricane:       |    --Peter Dalgaard in alt.sysadmin.recovery
>   30.44406N 86.59909W  |
>
> Point Lobos Photography Set 1 (Photo-posters):  http://jdgapps.com
>
> --
> 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