How do I do single search query?

0

I am trying to load data obtained from the database so I can use it for further processing(like charts and the use of buttons) but I came to realize that when running the code below, the program stays in query mode and does not quit, so how do I do single query or a read? I have looked around the forms but I have not found anything similar to my problem.

Amplify.DataStore.query(
            Holder::class.java,
            { items ->
                while (items.hasNext()) {
                    val item = items.next()
                    Log.i("Amplify", "Uploaded time: " + item.completedAt)
                    Log.i("Amplify", "Data Uploaded: " + item.data)
                    temp = item.data.toMutableList()
                    //Log.i("Debug1", "Held Data: $temp")

                }
            },
            { failure -> Log.e("Amplify", "Could not query DataStore", failure) }
        )
kpt
preguntada hace 2 años78 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas