Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. new HttpHandler(this, URL, Path, qHeaders, qValues) {
  2. @Override
  3. protected void onPreExecute() {
  4. progress.setTitle("Please Wait");
  5. progress.setMessage("Verifying your credentials");
  6. progress.setCancelable(false);
  7. progress.show();
  8. }
  9.  
  10. @Override
  11. protected void onPostExecute(Void aVoid) {
  12. DisplayLog(getClass(), "onPostExecute");
  13. if (progress.isShowing()) progress.cancel();
  14. try {
  15. final JSONObject Response = new JSONObject(getResponse());
  16. final Boolean success = getSuccess();
  17. final Boolean user_verified = (Boolean) Response.get("user_verified");
  18. final String session_ID = (String) Response.get("session_id");
  19.  
  20. if (success && !user_verified)
  21. throw new Exception(USER_NOT_VERIFIED);
  22.  
  23. SESSION_ID = session_ID;
  24.  
  25. SD.setSessionID(SESSION_ID);
  26.  
  27. SD.run();
  28. } catch (JSONException e) {
  29. HandleNavigation(UNKNOWN_ERROR);
  30. } catch (Exception e) {
  31. if (e.getMessage().equals(USER_NOT_VERIFIED))
  32. HandleNavigation(e.getMessage());
  33. else HandleNavigation(UNKNOWN_ERROR);
  34. }
  35. }
  36. }.execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement