Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<String> options_array = new ArrayList<String>();
- CharSequence[] items = new CharSequence[10];
- //m_options is a JSONArray of elements
- try
- {
- String array_chk_options;
- for (int j = 0; j < m_options.length(); j++) {
- array_chk_options = new String(m_options.getJSONObject(j).optString("label").toString());
- options_array.add(array_chk_options); //adds the elements whose key is "label" to the list
- items = options_array.toArray(new CharSequence[options_array.size()]);
- }
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement