Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. List<String> options_array = new ArrayList<String>();
  2. CharSequence[] items = new CharSequence[10];
  3. //m_options is a JSONArray of elements
  4. try
  5. {
  6. String array_chk_options;
  7. for (int j = 0; j < m_options.length(); j++) {
  8. array_chk_options = new String(m_options.getJSONObject(j).optString("label").toString());
  9. options_array.add(array_chk_options); //adds the elements whose key is "label" to the list
  10. items = options_array.toArray(new CharSequence[options_array.size()]);
  11. }
  12. }
  13. catch(Exception e)
  14. {
  15. e.printStackTrace();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement