-1

I have an API that gives the following JSON data as a response.

{
"status": 200,
"error": false,
"user": [
    {
        "id": "1",
        "nama": "Jane Doe",
        "handphone": "081234567890",
        "email": "janedoe@gmail.com",
        "nama_bisnis": "Permata Cell",
        "pekerjaan": "Wirausaha",
        "fb_id": "Jane Doe",
        "ig_id": "@jane_doe",
        "no_wa": "0812345678",
        "komentar": "",
        "user": "http://agenproduk.dianarthaselaras.com/user_img/1.jpeg"
    },
    {
        "id": "8",
        "nama": "Arifin",
        "handphone": "janedoe@gmail.com",
        "email": "081234567890",
        "nama_bisnis": "tripay",
        "pekerjaan": "pengusaha",
        "fb_id": "",
        "ig_id": "",
        "no_wa": "",
        "komentar": "",
        "user": ""
    }
]
}

How to find the size of the user array from the response & set it to a textview.
Any example would be helpful.

Abhimanyu
  • 11,351
  • 7
  • 51
  • 121
Agung Jaya
  • 23
  • 5

1 Answers1

1

In this link how to parse json with volley you can find the code needed to parse Json and after parsing you can get rows count and assign it to textview like:

int count = jsonArray.length(); 
countTv.setText(Integer.toString(count))
Aditya Kurkure
  • 422
  • 5
  • 19
Mkhakpaki
  • 120
  • 2
  • 12