public void checkLight(){
RequestQueue queue = Volley.newRequestQueue(mContext);
@Override
public void onResponse(JSONObject response) {
try {
String statValue = response.getJSONArray("Results").getJSONObject(0).getJSONObject("Readings").getJSONObject("state").getString("Value");
switch (statValue){
case "off":
lightStatus = false;
break;
case "on":
lightStatus = true;
break;
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {}
});
queue.add(jsObjRequest);
}
05-03 15:02:08.582 717-717/de.resper.autoheim W/libc﹕ pthread_create failed: couldn't allocate 1064960-byte stack: Out of memory
05-03 15:02:08.588 717-717/de.resper.autoheim E/art﹕ Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
05-03 15:02:08.590 717-717/de.resper.autoheim D/AndroidRuntime﹕ Shutting down VM
05-03 15:02:08.598 717-717/de.resper.autoheim E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: de.resper.autoheim, PID: 717
java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:1063)
at com.android.volley.RequestQueue.start(RequestQueue.java:152)
at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:66)
at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:78)
at de.resper.autoheim.controls.CtrlWz.checkLight(CtrlWz.java:46)
at de.resper.autoheim.WohnzimmerActivity$1.run(WohnzimmerActivity.java:43)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
05-03 15:03:38.396 717-717/de.resper.autoheim I/Process﹕ Sending signal. PID: 717 SIG: 9