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
demandé il y a 2 ans78 vues
Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions