-1

I have getting response following json format. I need to message value only. how to segregate the message value. can you please help me.

{status:"1", message:"cu34343"}
kathir
  • 25
  • 5

1 Answers1

0

if response as object

val jsonObject = JSONTokener(response).nextValue() as JSONObject
val message = jsonObject.getString("message")// Before That check null or 
not
Log.i("message: ", message)

also refer different response using gson and response model class converter.

RAMCODER
  • 61
  • 6