@Override public void onCancel(DialogInterface dialog) { this.cancel(true); mProgressHUD.dismiss(); }
protected void onPostExecute(Void unused) { // NOTE: You can call UI Element here. // Close progress dialog mProgressHUD.dismiss(); try { JSONObject json_data = new JSONObject(result); String status = json_data.getString("status"); if (status.equals("false")) { new AlertDialog.Builder(LoginActivity.this) .setTitle(R.string.app_name) .setMessage(R.string.Password_is_Match) .setNeutralButton(R.string.OK_btn, null) .setInverseBackgroundForced(true) .show(); } else { JSONObject json_obj1 = json_data.getJSONObject("userinfo"); String status1 = json_obj1.getString("status").toString(); String Email = json_obj1.getString("email").toString(); String user_id = json_obj1.getString("userid").toString(); String firstname = json_obj1.getString("fname").toString(); prefs = getSharedPreferences(prefName, MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); // ---save the values in the EditText view to preferences--- editor.putString("firstname", firstname); editor.putString("status", status1); editor.putString("Email", Email); editor.putString("user_id", user_id); // ---saves the values--- editor.commit(); progressDialog.dismiss(); Log.d("Original data : ", "" + status1 + "" + Email); Intent intent = new Intent(LoginActivity.this, Search_catagory.class); // Intent intent = new Intent(LoginActivity.this,Home_activity.class); startActivity(intent); } /* if(json_data==null) { new AlertDialog.Builder(LoginActivity.this).setTitle(R.string.app_name).setMessage(R.string.Password_is_Match).setNeutralButton(R.string.OK_btn,null).setInverseBackgroundForced(true).show(); }else { Log.d("json_data : ", "" + json_data); String flag = json_data.getString("code").toString(); if (flag.equals("5")) { new AlertDialog.Builder(LoginActivity.this).setTitle(R.string.app_name).setMessage(R.string.Password_is_Match).setNeutralButton(R.string.OK_btn,null).setInverseBackgroundForced(true).show(); }else if (flag.equals("4")) { new AlertDialog.Builder(LoginActivity.this).setTitle(R.string.app_name).setMessage(R.string.User_not_Creted).setNeutralButton(R.string.OK_btn,null).setInverseBackgroundForced(true).show(); }else { } }*/ } catch (Exception e) { Log.e("Fail 3", e.toString()); } }