Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " {"clientes": " +
- " [" +
- " { "idClientesT": 1," +
- " "tipo":"s"," +
- " "nome":"Carlos"" +
- " }," +
- " { "idClientesT": 2," +
- " "tipo":"s"," +
- " "nome":"Rogério"" +
- " }" +
- " ]" +
- "}";
- try {
- JSONObject clientes = new JSONObject(jsonCli);
- JSONArray arrayPlanetas = clientes.getJSONArray("clientes");
- for (int i = 0; i < arrayPlanetas.length(); i++) {
- JSONObject cliente = arrayPlanetas.getJSONObject(i);
- Log.d("idClientesT", cliente.getString("idClientesT"));
- Log.d("tipo", cliente.getString("tipo"));
- Log.d("nome", cliente.getString("nome"));
- }
- } catch (JSONException e) {
- e.printStackTrace();
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.form);
- clientes(jsonClientes);
- }
- {"clientes":[{"idClientesT":"1","tipo":"s","nome":"Carlos"},{"idClientesT":"2","tipo":"s","nome":"Rogério"}]}
- JSONArray arrayPlanetas = clientes.getJSONArray("clientes");
- .getJSONArray("clientes");
- .getJSONArray(url);
Add Comment
Please, Sign In to add comment