Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected JSONObject doInBackground(String... params) {
- try {
- //Url
- api = ServiceUrl.getBaseUrl() + ServiceUrl.getLoginUrl();
- //build JsonObject
- jsonParams = new JSONObject();
- String userName = this.muserName; // params[0] is username
- String password = this.mpassword; // params[1] is password
- jsonParams.put("user_name", userName);
- jsonParams.put("password", password);
- ServerRequest request = new ServerRequest(api, jsonParams);
- return request.sendRequest();
- } catch (UnknownHostException e) {
- progressDialog.dismiss();
- activity.showAlert("Please check internet connection.");
- return Excpetion2JSON.getJSON(e); // returns exception here
- }catch (JSONException je) {
- progressDialog.dismiss();
- activity.showAlert("Please check internet connection.");
- return Excpetion2JSON.getJSON(je); // returns exception here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement