Answer the question
In order to leave comments, you need to log in
How to add a new recyclerView item to the top of the list?
I am using SQLite. When I click the save button after creating the element, I call the function in DbManager:
fun insertToDb(title: String, content: String, imageUri: String) {
val values = ContentValues().apply {
put(DbName.COLUMN_TITLE, title)
put(DbName.COLUMN_CONTENT, content)
put(DbName.COLUMN_IMAGE_URI, imageUri)
}
db?.insert(DbName.NOTE_TABLE, null, values)
}
Answer the question
In order to leave comments, you need to log in
In general, the database has the right to give data in an arbitrary order, so explicitly set order by in the request for the field you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question