Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new HttpHandler(this, URL, Path, qHeaders, qValues) {
- @Override
- protected void onPreExecute() {
- progress.setTitle("Please Wait");
- progress.setMessage("Verifying your credentials");
- progress.setCancelable(false);
- progress.show();
- }
- @Override
- protected void onPostExecute(Void aVoid) {
- DisplayLog(getClass(), "onPostExecute");
- if (progress.isShowing()) progress.cancel();
- try {
- final JSONObject Response = new JSONObject(getResponse());
- final Boolean success = getSuccess();
- final Boolean user_verified = (Boolean) Response.get("user_verified");
- final String session_ID = (String) Response.get("session_id");
- if (success && !user_verified)
- throw new Exception(USER_NOT_VERIFIED);
- SESSION_ID = session_ID;
- SD.setSessionID(SESSION_ID);
- SD.run();
- } catch (JSONException e) {
- HandleNavigation(UNKNOWN_ERROR);
- } catch (Exception e) {
- if (e.getMessage().equals(USER_NOT_VERIFIED))
- HandleNavigation(e.getMessage());
- else HandleNavigation(UNKNOWN_ERROR);
- }
- }
- }.execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement