name: Codelab: Read and update data with Room
about: Problem with one item in the codelab
title: Read and update data with Room
labels: ''room database navigate terminate
assignees: ''
URL of codelab:
Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found?
Step 8, deleting items from the database
Describe the problem
In the ItemEditScreen is is possible to press the Delete button to remove a current item. This appears
to succeed but when the navigateBack operation is executed the app returns to the previous screen
with the deleted entry still showing. The app then crashes, and the logcat shows the following error message:
"java.lang.IllegalStateException: The query result was empty, but expected a single row to return a NON-NULL object of type 'com.example.inventory.data.Item'."
Restarting the app shows that the item in question has been correctly deleted.
Steps to reproduce?
- Go to... home page, add items if none present
- Click on... any item to navigate to the EditDetailsScreen, and press the "Delete" button
- See error... as mentioned above in logcat, after the app terminates
Versions
Android Studio version: quail
API version of the emulator: 37.1 (Google Pixel 6a)
Additional information
Include screenshots if they would be useful in clarifying the problem.
name: Codelab: Read and update data with Room
about: Problem with one item in the codelab
title: Read and update data with Room
labels: ''room database navigate terminate
assignees: ''
URL of codelab:
Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found?
Step 8, deleting items from the database
Describe the problem
In the ItemEditScreen is is possible to press the Delete button to remove a current item. This appears
to succeed but when the navigateBack operation is executed the app returns to the previous screen
with the deleted entry still showing. The app then crashes, and the logcat shows the following error message:
"java.lang.IllegalStateException: The query result was empty, but expected a single row to return a NON-NULL object of type 'com.example.inventory.
data.Item'."Restarting the app shows that the item in question has been correctly deleted.
Steps to reproduce?
Versions
Android Studio version: quail
API version of the emulator: 37.1 (Google Pixel 6a)
Additional information
Include screenshots if they would be useful in clarifying the problem.