binding.btnData.setOnClickListener{ pillRequest() }
First, the code is a structure that activates the retrofit-related code by pressing btnData. After running it on the emulator,If I press btnData quickly, the following error appears.
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
However, If I press the button after a while, the error does not appear and it works normally.
As for the value delivered, only the same value was delivered without changing, and only the timing of pressing the button is different, so why does the error not appear or appear?
That error message
"Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $"typically indicates a mismatch between the expected JSON response and the actual response received by your Retrofit call.firstly verify the json responce and cehck the sever side errors