Example usage for android.net NetworkRequest.ErrorType toString

List of usage examples for android.net NetworkRequest.ErrorType toString

Introduction

In this page you can find the example usage for android.net NetworkRequest.ErrorType toString.

Prototype

public String toString() 

Source Link

Usage

From source file:com.mobello.shift.fragments.Settings.java

private void getNotificationSettings(HashMap<String, String> param, boolean isProgress) {
    new NetworkRequest(getActivity(), isProgress, new NetworkRequest.CallbackInterface() {
        @Override/*from   www . j a va  2  s.com*/
        public void onRequestSuccess(JSONObject jsonObject) {
            try {
                status = jsonObject.getString("status");
                if (status.equalsIgnoreCase(Constant.SUCCESS)) {
                    matchNotification = jsonObject.getString("match_notification");
                    likeNotification = jsonObject.getString("like_notification");
                    newJobNotification = jsonObject.getString("new_jobs_notification");
                    if (!isLoad) {
                        if (matchNotification.equalsIgnoreCase("1"))
                            switchMatch.setChecked(true);
                        else
                            isMatchTrigger = true;
                        if (likeNotification.equalsIgnoreCase("1"))
                            switchLikes.setChecked(true);
                        else
                            isLikesTrigger = true;
                        if (newJobNotification.equalsIgnoreCase("1"))
                            switchNewJobs.setChecked(true);
                        else
                            isNewJobsTrigger = true;
                        isLoad = true;
                    }
                }
            } catch (JSONException e) {
                Helper.showJsonParserError(getActivity());
                e.printStackTrace();
            }
        }

        @Override
        public void onRequestFailed(NetworkRequest.ErrorType errorType) {
            Helper.showErrorMessage(getActivity(), errorType.toString());

        }
    }, param, Constant.URL_SETTINGS + token, Constant.POST_METHOD).execute();
}