You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In todo_item.xml I am setting the "onClick" attribute to the LinearLayout which, in turn, contains the cardview with the note. As below I am using the removeNote() method from MainViewModel and passing in the position variable like below:
When I try to make the removeNote function a void function I cannot find it from the xml. The only solution that worked for me was to make it return something. So even if it doesnt need to I made return a boolean just to find it:
//This function removes a note from the database and sets a new Adapter with the updated list of notes.
public boolean removeNote(long id) {
//Call mDb.delete to pass in the TABLE_NAME and the condition that WaitlistEntry._ID equals id
mDb.delete(ToDoContract.TodoEntry.TABLE_NAME, ToDoContract.TodoEntry._ID + "=" +
String.valueOf(id), null);
MainActivity.mTodoRecyclerView.setAdapter(new ToDoAdapter(allNotes(), this));
Log.d(TAG, "removeNote: " + "clicked");
return true;
}
I am trying to figure out why this is, and if there is a way to call void functions and still pass them parameters.
The text was updated successfully, but these errors were encountered:
In todo_item.xml I am setting the "onClick" attribute to the LinearLayout which, in turn, contains the cardview with the note. As below I am using the removeNote() method from MainViewModel and passing in the position variable like below:
When I try to make the removeNote function a void function I cannot find it from the xml. The only solution that worked for me was to make it return something. So even if it doesnt need to I made return a boolean just to find it:
I am trying to figure out why this is, and if there is a way to call void functions and still pass them parameters.
The text was updated successfully, but these errors were encountered: