Json object android retrofit
Résolu/Fermé
DalyMHY
Messages postés
6
Date d'inscription
mercredi 18 mars 2020
Statut
Membre
Dernière intervention
19 mars 2020
-
Modifié le 19 mars 2020 à 10:24
DalyMHY Messages postés 6 Date d'inscription mercredi 18 mars 2020 Statut Membre Dernière intervention 19 mars 2020 - 19 mars 2020 à 12:24
DalyMHY Messages postés 6 Date d'inscription mercredi 18 mars 2020 Statut Membre Dernière intervention 19 mars 2020 - 19 mars 2020 à 12:24
A voir également:
- Json object android retrofit
- Android - Guide
- Android recovery - Guide
- Jouer a pokemon sur android - Guide
- Begone android - Accueil - Protection
- Voir mot de passe wifi android - Guide
2 réponses
BunoCS
Messages postés
15505
Date d'inscription
lundi 11 juillet 2005
Statut
Modérateur
Dernière intervention
5 février 2025
3 913
19 mars 2020 à 12:18
19 mars 2020 à 12:18
Tu n'as pas dû chercher beaucoup ;)
Aller, c'est bien parce que c'est rapide à faire...A priori, il te suffit de faire ceci :
Aller, c'est bien parce que c'est rapide à faire...A priori, il te suffit de faire ceci :
if (response.isSuccessful() && response.body() != null) { String jsonresponse = response.body().toString(); try { JSONObject jsonObject = new JSONObject(jsonresponse); if (jsonObject.getString("status").equals("success")) { JSONObject jsonData = jsonObject.getString("data")); int id = jsonData.getInt("id"); } ...
BunoCS
Messages postés
15505
Date d'inscription
lundi 11 juillet 2005
Statut
Modérateur
Dernière intervention
5 février 2025
3 913
Modifié le 19 mars 2020 à 10:27
Modifié le 19 mars 2020 à 10:27
Hello,
Tu peux parcourir ton JSONObject avec les méthodes
Plus d'infos ici
Tu peux parcourir ton JSONObject avec les méthodes
get(),
getJSONObject(),
getString().
Plus d'infos ici
DalyMHY
Messages postés
6
Date d'inscription
mercredi 18 mars 2020
Statut
Membre
Dernière intervention
19 mars 2020
19 mars 2020 à 11:06
19 mars 2020 à 11:06
J'ai pas réussi à trouver la résultat
19 mars 2020 à 12:24
J'ai réussi à trouver la solution