I have this code in an Android activity;
public static TwoWeeksActivity context;
public static DBHelper dbHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_two_weeks);
RadCartesianChartView chartView = new RadCartesianChartView(this);
ViewGroup rootView = (ViewGroup)findViewById(R.id.container);
rootView.addView(chartView);
ArrayList<DateCountChart> vvv=new ArrayList<DateCountChart>();
vvv=dbHelper.getCigCountTwoWeeks();
When I execute the app, when it arrives at tthis last line it returns java null pointer exception.
Why vvv is null? I have instantiated it:
ArrayList<DateCountChart> vvv=new ArrayList<DateCountChart>();
Please note that
dbHelper.getCigCountTwoWeeks();
function in in dbhelper returns ArrayList of DateCountChart object
Any help appreciated.