Question: I am using the [GraphView Library](http://www.android-graphview.org//) to render a graph. I have placed a checkbox below the graph so that the user can show / hide the legend in the graph. When the user clicks this button, I need to refresh the GraphView.

I tried redrawAll(), but Android Studio says it "cannot resolve symbol".

Here is the code:

```
    chart = (GraphView) chartView.findViewById(R.id.chart);
    // Some code goes here
    chart.redrawAll();

```

What other method is availabe to redraw the graph?

Answer: 
> 
> but not showing anydata in listview
> 
> 
> 

Because you told it not to create any views. 

```
@Override
public int getCount() {
    return 0;
}

```

You are using an ArrayAdapter. You don't need to implement `getCount`, but if you do, return the size of the list

```
@Override
public int getCount() {
    return arraydata == null ? 0 : arraydata.size();
}

```

---

Anyways, regarding your question, tend to use `MainActivity.this` like you have done for the Context (Activities are Contexts). 

If your error is here

```
LayoutInflater inflater = LayoutInflater.from(getContext());

```

Then, that could instead be 

```
LayoutInflater inflater = LayoutInflater.from(this.context);

```

which you got the context from the constructor
you are overriding method getCount(); and it is returning zero, you have to return the size of the array-list.