Android プロジェクトで JSONObject を作成しようとしています。動作しているように見えますが、最後に入れたものしか覚えていないようです。このコード:
JSONObject json = new JSONObject();
try {
json.put("text", "thi sis the message");
json.put("customer_uuid", customer_uuid);
Log.wtf(json.toString(), "asassa");
} catch (JSONException e) {
Log.wtf("WTF", e);
}
印刷し{"customer_uuid": "123"}
ます。しかし、customer_uuid が入っている行を消去すると、出力されるだけ{"text", "thi sis the message"}
です。
最後に入力したものだけを覚えているのはなぜですか? さらに重要なことは、どうすれば両方のものを保存できるのでしょうか? すべてのヒントは大歓迎です!