I'm trying to create a JSONArray in a file that is in a linked Folder to a Android Project, and eclipse is suddenly (didn't do this before) giving me the error : Call requires API level 19 (current min is 14): new org.json.JSONArray
the code where it happens is as following:
String[] s = (save_val.trim().equals(""))?new String[]{}:save_val.split("\n");
JSONObject o = null;
if (!Arrays.equals(s, save_names)){
new JSONArray(s); // this is where the error is shown
EDIT: SOLUTION the method in fact isn't introduced before API 19, but if you use (as in my case) String array or other promitives you can simply do:
JSONArray s_values = new JSONArray();
for (int i = 0; i < s.length; i++){
s_values.put(yourarray[i]);
}
this shouldn't be any slower