0
How I turn this string in an array on my Android so I can manipulate it?
[{"id":"1","login":"Admin","senha":"Admin","nome":"Admin","msg":"Eba","logado":"0"},
{"id":"7","login":"Daniel","senha":"1234","nome":"Daniel","msg":"","logado":"0"},
{"id":"8","login":"Dannark","senha":"1234","nome":"Dannark","msg":"","logado":"0"},
{"id":"9","login":"Joosi","senha":"99487452","nome":"Joosi","msg":"","logado":"0"}]
I’ve been trying this way:
/*Conn.response é a minha array*/
JSONObject object = (JSONObject) new JSONTokener(Conn.response).nextValue();
id = object.getString("0");
nome = object.getString("3");
msg = object.getString("4");
However, it only works in the following format:
{"0":"1","1":"Admin","2":"1234","3":"Adm","4":"message","5":"0"}
You need to add more information. How your array is declared
Conn
?– Jorge B.
Jorge B. Actually the variable Conn.resonse is a string, and that would need to transfer it into an array
– Dannark