I would really appreciate some help! I am working on a project and I am stuck at this part!
Log cat:
java.lang.NullPointerException: Attempt to invoke interface method 'int android.database.Cursor.getColumnIndex(java.lang.String)' on a null object reference
at com.example.workhours.NotesCustomAdapter.onBindViewHolder(NotesCustomAdapter.java:38)
at com.example.workhours.NotesCustomAdapter.onBindViewHolder(NotesCustomAdapter.java:16)
code:
 16)  public class NotesCustomAdapter extends RecyclerView.Adapter<NotesCustomAdapter.ViewHolder>{
 17)      private ArrayList<newNote> arrayListNote;
 18)      private Context context;
 19)      Cursor cursor;
 20)   public NotesCustomAdapter(ArrayList<newNote> arrayListNote, Context context) {
 21)        this.arrayListNote = arrayListNote;
 22)        this.context = context;
 23)    }
 35)    @Override
 36)    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
 37)        holder.notePadTextView.setText(arrayListNote.get(position).getNote());
 38)        long id = cursor.getLong(cursor.getColumnIndex(DataBaseHelper.COL_0));
 39)        holder.itemView.setTag(id);
 40)    }
 
    