fixed androidstduio derp

fixed stripes aren't loaded correctly
This commit is contained in:
Giovanni Harting
2015-09-13 17:18:18 +02:00
parent 3f66b67e4c
commit 1e7e400d49
3 changed files with 3 additions and 148 deletions

View File

@@ -144,6 +144,7 @@ public class LedDHelper {
@Override
public void onResponse(JSONObject response) {
try {
System.out.println("got resp: " + response.toString());
if (response.getBoolean("success")) {
ledDDaemon.getControllers().clear();
List<LedStripe> list = new ArrayList<>();
@@ -160,7 +161,7 @@ public class LedDHelper {
JSONArray jstripes = row.getJSONArray("stripes");
for (int o = 0; o < jstripes.length(); o++) {
JSONObject srow = jstripes.getJSONObject(i);
JSONObject srow = jstripes.getJSONObject(o);
LedStripe nStripe = new LedStripe();
nStripe.setId(srow.getInt("id"));
nStripe.setRGB(srow.getBoolean("rgb"));