Get JSON key name using GSON

后端 未结 3 1760
名媛妹妹
名媛妹妹 2021-02-14 01:48

I have a JSON array which contains objects such as this:

{
    \"bjones\": {
        \"fname\": \"Betty\",
        \"lname\": \"Jones\",
        \"password\": \         


        
3条回答
  •  南旧
    南旧 (楼主)
    2021-02-14 02:32

    Using keySet() directly excludes the necessity in iteration:

    ArrayList objectKeys =
      new ArrayList(
        myJsonObject.keySet());
    

提交回复
热议问题