Vote count:
0
I know that the problem resides in the fact that IntentService is on a separate thread from the UI thread. With this being the problem, how would I fill out my sDataArray & sData2Array class variables?
JsonObjectRequest jsonObjRequest = new JsonObjectRequest(Request.Method.POST, URL,
jsonObjectQuery, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response){
Log.d(TAG, response.toString());
try {
JSONObject results;
JSONArray seriesArray;
JSONObject DataSeries;
JSONObject Data2Series;
results = response.getJSONObject("Results");
seriesArray = results.getJSONArray("series");
DataSeries = seriesArray.getJSONObject(0);
sDataArray = DataSeries.getJSONArray("data"); <------
Data2Series = seriesArray.getJSONObject(1);
sData2Array = Data2Series.getJSONArray("data"); <------
downloadAllData();
} catch (JSONException e) {
e.printStackTrace();
}
}
}
asked 35 secs ago
How to get volley onResponse returned to my Intent Service thread?
Aucun commentaire:
Enregistrer un commentaire