I am new to Android and I am not able to figure out a way to retrieve integer values and display them in a list view.

```
public class NewsItem {

    private int content;

    public int getContent() {    
        return content;
    }

    public void setContent(int content) {

      this.content = content;
    }
}

```

**Adapter class**

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

        ViewHolder viewHolder;
        if (convertView == null) {
            convertView = layoutInflater.inflate(R.layout.householdincomeview, null);

            viewHolder = new ViewHolder();
            viewHolder.headlineView(TextView) convertView.findViewById(R.id.content);

        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }

        viewHolder.headlineView.
                setText(arrayList.get(position).getContent());
        return convertView;
    }

    static class ViewHolder {
        TextView headlineView;

    }

```

**Activity class**

```
final ListView listView = (ListView) findViewById(R.id.viewincome);

ArrayList<NewsItem> getData = getitem();
listView.setAdapter(newHouseHoldincomeAdapter(this,getData));

private ArrayList<NewsItem> getitem() {
    ArrayList<NewsItem> result = new ArrayList<NewsItem>();
    NewsItem newsItem = new NewsItem();

    newsItem.setContent(1);

    return result;
}

```

The listview is accepting the string values, but when i try to retrieve integers in getview, I am getting error as null pointer exception. How do i display integer values?