> String sMenuItems[] = {"Menu Item1", "Menu Item2", "Menu Item3"};
>
> List<String> list = Arrays.*asList*(sMenuItems);
>
> ArrayAdapter aListAdapter = *new* ArrayAdapter(*this*,R.layout.*list_row*
> ,list);
>
> setListAdapter(aListAdapter);
>
> }
>
> here layout of list_row is a single TextView view only.
>
> But it is returning me an error that references to generic type
> ArrayAdapter
> <T> should be parameterized. What does this error means and is there any
> other way to display a simple menu of some static entries?

This error means you need to use your ArrayAdapter like you are using your
List in your code:

ArrayAdapter<String> aListAdapter = new
ArrayAdapter<String>(this,R.layout.list_row,list);

ArrayAdapter can "adapt" all sorts of classes; you need to tell it what
type of class it adapts. Generics and parameterized types are features of
Java 5 that Android also support and use.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ -- Available Now!


--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to