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
feita há 2 anos78 visualizações
Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas