JSON getting nested in a POJO

后端 未结 2 1433
太阳男子
太阳男子 2021-01-28 14:20

I have a POJO class as:

public class D{

    private JSONObject profileData;


    public JSONObject getProfileData ()
    {
        return profileData;
    }

         


        
2条回答
  •  [愿得一人]
    2021-01-28 15:01

    You don't need to use Gson to convert hashmap to a json object. Simply use:

    profileDataInJson = new JSONObject(map);

提交回复
热议问题