Custom adapter not working
<p>I've a custom adapter for my <code>ListView</code>. It gives me <code>NullPointerException</code> at the <code>setAdapter</code>. I've gone through my code several times and couldn't figure out what is causing NPE. Following are the relevant code snippets:</p>

<p>Activity: </p>

<pre><code>ListView mListView;
Vector&lt;DashboardBean&gt; dashboardBean= new Vector&lt;DashboardBean&gt;();
MyCustomAdapter adapter;

adapter = new MyCustomAdapter(MyDashboardActivity.this, 
              R.layout.testdashboard_row, dashboardBean);

        adapter.clear();

dashboardBean.add(new DashboardBean(projects, workRequests, status)); 
        mListView.setAdapter(adapter);
</code></pre>

<p>Dashboardbean: </p>

<pre><code>public class DashboardBean {

    public String project;
    public String workRequest;
    public String startDate;
    public String status;   
    public String actualHours;
    public String actualMins;


    public DashboardBean(String project, String workRequest,String status)
    {
        this.project = project;
        this.workRequest = workRequest;
        this.status = status;
    }

}
</code></pre>

<p>CustomAdapter:</p>

<pre><code>public class MyCustomAdapter extends ArrayAdapter&lt;DashboardBean&gt; {


Context context;
int layoutResourceId;
DashboardBean currentMRB;
Vector&lt;DashboardBean&gt; data;

public MyCustomAdapter(Context context, int layoutResourceId, Vector&lt;DashboardBean&gt; data) 
{
    super(context,layoutResourceId,data);
    this.layoutResourceId = layoutResourceId;
    this.context=context;
    this.data = data;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    View row = convertView;
    MyStringReaderHolder holder;


    if(row==null)
    {
        LayoutInflater inflater = ((Activity)context).getLayoutInflater();
        row = inflater.inflate(layoutResourceId, parent,false);

        holder= new MyStringReaderHolder();


        holder.project = (TextView)row.findViewById(R.id.project);
        holder.workRequest = (TextView)row.findViewById(R.id.work_request);
        holder.status = (TextView) row.findViewById(R.id.status);


        row.setTag(holder);
    }
    else
    {
        holder=(MyStringReaderHolder) row.getTag();
    }

    DashboardBean mrb = data.elementAt(position);

    holder.project.setText(mrb.project);
    holder.workRequest.setText(mrb.workRequest);
    holder.status.setText(mrb.status);

    return row;
}

static class MyStringReaderHolder
{
TextView project, workRequest, startDate, status, actualHours;

 }
 }
</code></pre>

<p>Could anyone help?</p>
