I want to get a value passed from another activity, it works well with multiple type like JSONArray, String, etc... but i could not find the way to retrieve a ArrayList value.
I tried several way like this one with no success:
ArrayList<JSONObject> poiArr;
JSONArray jsonPoints;
try {
poiArr = new ArrayList<JSONObject>(bundle.getSparseParcelableArray("poiArr"));
//here is the problem
} catch (Exception e) {
e.printStackTrace();
}
try {
jsonPoints = new JSONArray(bundle.getString("lesPoints"));
} catch (JSONException e) {
e.printStackTrace();
}
I have this error message:
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object[] java.util.Collection.toArray()' on a null object reference
Any ideas?