Android - JSONException No value for

后端 未结 1 1230
长发绾君心
长发绾君心 2020-12-18 22:35

I know that there are several questions posted on here with the same topic and error, but none of them indicate the same problem as mine, so I decided to post my question he

相关标签:
1条回答
  • 2020-12-18 22:55

    You are using the wrong object to get avatar value here json.getString(KEY_AVA). It should be json_user.getString(KEY_AVA).

    Also, you can use optString instead of getString which just returns null if value doesn't exist, instead of throwing an exception.

    0 讨论(0)
提交回复
热议问题