Q:

how to get int value from AsyncTask

I want to get the Status value GetLoginDetails() method..but i dont know how to do it. 
Can any one help me to do this?  Following is my work done..
LoginScreen.java
            public class LoginScreen extends Activity implements OnClickListener{
            EditText etusername,etpassword;
            public static Integer status= -1;
            private ProgressDialog pDialog;
            // URL to get contacts JSON
            private static String url= "http://xxx.xxx.x.xxx/abc/login.php";
            private static final String LOGIN = "Login";
            private static final String STATUS = "Status";
            // contacts JSONArray
            JSONArray loginjsonarray=null;
            @Override
            protected void onCreate(Bundle savedInstanceState){
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_login_screen);
                initialize();
            }
        //Initialization of components
            private void initialize() {
                //Getting the reference of font from assets folder
                String fontPath = "Font/Arsenal-Regular.otf";
                Typeface tf = Typeface.createFromAsset(getAssets(),fontPath);
              //Getting the reference of EditText
                etusername=(EditText)findViewById(R.id.editTextLoginusernamenumber);
                etpassword=(EditText)findViewById(R.id.editTextLoginpassword);
                //Getting the reference of textView
                TextView textViewloginforgotpassword=(TextView)findViewById(R.id.textViewloginforgotpassword);
                //set font to textView
                textViewloginforgotpassword.setTypeface(tf);
                //set underline TextView
                textViewloginforgotpassword.setPaintFlags(Paint. UNDERLINE_TEXT_FLAG);
                //Getting references of buttons
                Button buttonlogin=(Button)findViewById(R.id.buttonlogin);
               //set on click listener on buttons
                buttonlogin.setOnClickListener(this);
            }//end of Initialization
            //on click method   
            @Override
            public void onClick(View v) {
                if(v.getId()==R.id.buttonlogin){
                    new GetLoginDetails().execute();
                    if(status==1)**//here I want to check that value**
                    {
                        Intent intent=new Intent(LoginScreen.this,MenuScreen.class);
                        startActivity(intent);
                        finish();
                    }
                 }
                }//end of on click
            @Override
            public void onBackPressed(){
                finish();
                super.onBackPressed();
            }
            private class GetLoginDetails  extends AsyncTask<Void, Void, Integer>
            {
                protected void onPreExecute() {
                    // Showing progress dialog
                    pDialog = new ProgressDialog(LoginScreen.this);
                    pDialog.setMessage("Loading...");
                    pDialog.setCancelable(false);
                    pDialog.show();
                }
                protected Integer doInBackground(Integer... arg) {
                    List<NameValuePair> params = new ArrayList<NameValuePair>();
                    params.add(new BasicNameValuePair("username",etusername.getText().toString()));
                    params.add(new BasicNameValuePair("userPassword", etpassword.getText().toString()));
                    // Creating service handler class instance
                    ServiceHandler sh = new ServiceHandler();
                     // Making a request to url and getting response
                    String jsonstr = sh.makeServiceCall(url, ServiceHandler. GET, params);
                    Log.d("Response: ", ">"+jsonstr);
                    if(jsonstr!=null){
                        try {
                                JSONObject jsonObj =new JSONObject(jsonstr);
                                loginjsonarray=jsonObj.getJSONArray(LOGIN);
                                for(int i=0;i<loginjsonarray.length();i++){
                                    JSONObject l=loginjsonarray.getJSONObject(i);
                                    status=l.getInt(STATUS);**//how to get this value to login_button onclick scope??** 
                                }
                            } catch (JSONException e) {
                                e.printStackTrace();
                            }
                    }else{
                        Log.e("ServiceHandler", "Couldn't get any data from the url");
                    }
                    return status;
                }
                protected void onPostExecute(Integer result) {
                    // Dismiss the progress dialog
                    if(pDialog.isShowing()){
                        pDialog.dismiss();
                    }
                    return result;
                }
            }
        }

ServiceHandler.java
                public class ServiceHandler {
                    static String response = null;
                    public final static int GET = 1;
                    public final static int POST = 2;
                    public String makeServiceCall(String url, int method) {
                        return this.makeServiceCall(url, method, null);
                    }
                    /**
                     * Making service call
                     * @url - url to make request
                     * @method - http request method
                     * @params - http request params
                     * */
                    public String makeServiceCall(String url, int method, List<NameValuePair> params)  {
                        try {
                                DefaultHttpClient httpClient=new DefaultHttpClient();
                                HttpEntity httpEntity=null;
                                HttpResponse httpResponse=null;
                                // Checking http request method type
                                if(method==POST){
                                    HttpPost httpPost=new HttpPost(url);
                                    if(params!=null)
                                    {
                                        //adding post params
                                        httpPost.setEntity(new UrlEncodedFormEntity(params));
                                    }
                                    httpResponse=httpClient.execute(httpPost);
                                }
                                else if(method==GET)
                                {
                                    // appending params to url
                                    if(params!=null)
                                    {
                                        String paramString=URLEncodedUtils.format(params, "utf-8");
                                        url +="?" +paramString;
                                    }
                                    HttpGet httpGet=new HttpGet(url);
                                    httpResponse=httpClient.execute(httpGet);
                                }
                                httpEntity=httpResponse.getEntity();
                                response=EntityUtils.toString(httpEntity);
                        } catch (UnsupportedEncodingException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        } catch (ClientProtocolException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        } catch (IOException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
                        return response;
                    }
            }

please help me as early as possible

A:

In your onPostExecute...  
Before the // Dismiss the progress dialog  
            //compare your status/integer value over here and depending on that, while dismissing the dialog
                    if(pDialog.isShowing() && compareValue()){
                        pDialog.dismiss();
                    //show a custom dialog maybe or depending on your requirement carry on with your implementation
                    } else {
                      //show the message to the user (not signed in or invalid credentials dialog etc)                   
 }

