Буду очень признателен за помощь! Я работаю над проектом, и я застрял в этой части!
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)
код:
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) }