@Override public void onRequestEnded(int $tag, Object $object) { switch ($tag) { case NumberConst.requestSuccess: Logg.w("AddActivityView | enclosing_method()", "Events sorting: success!"); Toast.makeText( EditActListActivity.this, "Events sorting: success!", Toast.LENGTH_SHORT) .show(); stopProgress(); finish(); break; case NumberConst.requestEndActions: Logg.w("AddActivityView | enclosing_method()", "Activity sucessfully loaded"); stopProgress(); addActions(); break; case NumberConst.requestEndRemoveAction: loadActions(); break; case NumberConst.requestFail: Logg.w("AddActivityView | enclosing_method()", "Network Failed"); Toast.makeText(EditActListActivity.this, "Network status is bad", Toast.LENGTH_SHORT) .show(); break; } }
/** * Success? * * @return */ public boolean isSuccess() { boolean kResult = true; try { if (hasKey("success")) { kResult = getBoolean("success"); error = getString("error"); if (!kResult) Logg.w("JsonNode | isSuccess()", "error : " + error); } } catch (Exception e) { } return kResult; }