It is because the list adaptor only takes in an array of string, where our vendor contains a list of menuitem which we need to convert to string (by taking the name of each menu item)

On Feb 5, 2013, at 1:20 PM, epaz <notifications@github.com> wrote:

> In src/com/intuitive/yummy/MenuActivity.java:
> 
> > @@ -17,7 +17,12 @@ protected void onCreate(Bundle savedInstanceState) {
> >          Intent intent = getIntent();
> >          menu = (com.intuitive.yummy.Menu)intent.getSerializableExtra("Menu");
> >          String[] menuItemsName;
> > -        if (menu.getMenuItem().size() == 0)
> > +        if (menu == null)
> > +        {
> > +        	menuItemsName = new String[1];
> > +        	menuItemsName[0] = "No menu available.";
> > +        }
> > +        else if (menu.getMenuItem().size() == 0)
> What's exactly the purpose of everything in this onCreate method? It seems like it's redundant because it's just copying a single property (Name) of each item in a collection (menu.getMenuItem() - which should also be renamed to getMenuItems) to a simple string array. I'm pretty sure this is an unnecessary step but I'm not entirely sure since it's hard to tell what this method is doing and why...
> 
> —
> Reply to this email directly or view it on GitHub.
> 
>