@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
NoteTaking_Activity noteTaking_activity = new NoteTaking_Activity();
arrayList = noteTaking_activity.getHeadlineArray();
ListView listView = (ListView) findViewById(R.id.List_Of_notes);
ArrayAdapter<String> adapter = new ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, arrayList );
listView.setAdapter( adapter );
Executing the code shown above results in the error message
Attempt to invoke interface method 'int java.util.List.size()' on a null object reference.
The array list is empty at first, but then users may fill it.
What can I do to resolve this error?