[Java for Android App Development] larryse:
I am creating a listview with a custom object containing 1 property(i will be creating other activities using objects with more than 1 property). my problem is it shows the correct number of rows but no text.

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="android link"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<ListView android:id="@+id/list"
android:layout_height="fill_parent"
android:layout_width="fill_parent"/>

</LinearLayout>

grid_item.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="android link"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minHeight="50dp">

<TextView android:id="@+id/item"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:text=""
android:layout_alignParentLeft="true"/>
</RelativeLayout>

object java

package com.example.sarahjmusicprotocol;

import java.io.Console;

public class CategoriesObject
{
String category;

public String getCategory() {
return category;
}

public void setCategory(String category) {
this.category = category;
}

public CategoriesObject()
{
}

public CategoriesObject(String category)
{
this.category=category;
}

private void print()
{
System.out.printf("Category: {0}",category);
}

[MENTION=439709]override[/MENTION]
public String toString()
{
return this.getCategory();
}
}

adapter java

package com.example.sarahjmusicprotocol;

import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class CategoryAdapter extends BaseAdapter
{
private List<CategoriesObject>	categoryList;
private LayoutInflater layoutInflater;

public CategoryAdapter(final Context context, final List<CategoriesObject> categoriesList)
{
//super(context,0);
this.categoryList = categoriesList;
//this.activity=a;
layoutInflater = LayoutInflater.from(context);
}

public CategoriesObject getItem(int position)
{
return categoryList.get(position);
}

public long getItemId(int position)
{
return position;
}

public View getView(int position, View convertView, ViewGroup parent)
{
ViewHolder holder;
if(convertView == null)
{
convertView = layoutInflater.inflate(R.layout.grid_item, null);
holder = new ViewHolder();
holder.titleView=(TextView)convertView.findViewById(R.id.item);
convertView.setTag(holder);
}
else
{
holder=(ViewHolder)convertView.getTag();
}

holder.titleView.setText(categoryList.get(position).getCategory());
return convertView;
}

public int getCount()
{
return categoryList.size();
}

private static class ViewHolder
{
public TextView titleView;
}
}

main java

package com.example.sarahjmusicprotocol;

import java.util.ArrayList;
import java.util.List;
import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Main extends Activity
{
private ListView view;
private CategoryAdapter adapter;
private List<CategoriesObject> categoriesList;

[MENTION=439709]override[/MENTION]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

//categoriesList = CategoryDomain.getCategoryDomain().getCategories();
categoriesList = getCategories();
view = (ListView)findViewById(R.id.list);
adapter = new CategoryAdapter(this,categoriesList);
view.setAdapter(adapter);
}

private ArrayList getCategories()
{
ArrayList<CategoriesObject> list = new ArrayList<CategoriesObject>();
list.add(new CategoriesObject("Publishing"));
list.add(new CategoriesObject("Publishing"));
list.add(new CategoriesObject("Publishing"));
list.add(new CategoriesObject("Publishing"));
list.add(new CategoriesObject("Publishing"));
list.add(new CategoriesObject("Publishing"));
return list;
}

[MENTION=439709]override[/MENTION]
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
//getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}

any help will be appreciated.