Greum
Well-Known Member
I'm following a tutorial to create and edit a simple database/table. All works fine, so I thought I would add a Toast message to let the user know the record had been added. Seemed simple enough, just add
after the database update. Thing is, it doesn't seem to understand getApplicationContext(). Every example I've seen for Toast is the same, so I'm stymied.
I don't know if the fact I'm using androidx makes any difference...
Code:
Toast.makeText(getApplicationContext(), "Record added", Toast.LENGTH_SHORT).show();
after the database update. Thing is, it doesn't seem to understand getApplicationContext(). Every example I've seen for Toast is the same, so I'm stymied.
I don't know if the fact I'm using androidx makes any difference...