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
asked 2 years ago76 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions