Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- refresh_btn.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- HttpHandler httpHandler1 = new HttpHandler();
- String res = null;
- String authToken = "MlSyULrWlFgVk28";
- try {
- Log.d("edwLog", TAG + " get_payment_notifications " + HttpHandler.API_URL + "get_payment_notifications/" + authToken + "/");
- res = httpHandler1.makeServiceCall(HttpHandler.API_URL + "get_payment_notifications/" + authToken + "/", HttpHandler.GET);
- Log.d("edwLog", TAG + " response > " + res);
- if (res != null) {
- JSONObject jsonObject = new JSONObject(res);
- String responseType = jsonObject.getString("type");
- if (responseType.equals("success")) {
- if (jsonObject.has("response")) {
- JSONArray jsonArray = jsonObject.getJSONArray("response");
- for (int i = 0; i < jsonArray.length(); i++) {
- notifications.add(jsonArray.getJSONObject(i));
- }
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- Log.d("edwLog", TAG + " IOException > " + e.toString());
- }
- }
- });
- public void onClick(View v)
- refresh_btn.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- HttpHandler httpHandler1 = new HttpHandler();
- String res = null;
- try {
- Log.d("edwLog", TAG + " get_payment_notifications " + HttpHandler.API_URL + "get_payment_notifications/" + AuthToken + "/");
- res = httpHandler1.makeServiceCall(HttpHandler.API_URL + "get_payment_notifications/" + AuthToken + "/", HttpHandler.GET);
- Log.d("edwLog", TAG + " response > " + res);
- if (res != null) {
- JSONObject jsonObject = new JSONObject(res);
- String responseType = jsonObject.getString("type");
- if (responseType.equals("success")) {
- if (jsonObject.has("response")) {
- JSONArray jsonArray = jsonObject.getJSONArray("response");
- for (int i = 0; i < jsonArray.length(); i++) {
- notifications.add(jsonArray.getJSONObject(i));
- }
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- Log.d("edwLog", TAG + " IOException > " + e.toString());
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement