Android-face book sdk log out issue
<p>I am using Facebook SDK to log in to Facebook. Initially it got logged in and i can get my profile information. but after logging out the session is still valid and when i try to access my profile it shows <code>"Error validating access token: The session has been invalidated because the user has changed the password"</code> .</p>

<p>Following is my code</p>

<pre><code>     @SuppressWarnings("deprecation")
public void loginToFacebook() {
    mPrefs = getPreferences(MODE_PRIVATE);
    String access_token = mPrefs.getString("access_token", null);
    long expires = mPrefs.getLong("access_expires", 0);

    if (access_token != null) {
        fb.setAccessToken(access_token);
    }

    if (expires != 0) {
        fb.setAccessExpires(expires);
    }


    if (!fb.isSessionValid()) {
        Log.v("login","yes");
        fb.authorize(this, new String[] { "email", "publish_stream" },new DialogListener() {

                    @Override
                    public void onCancel() {
                        // Function to handle cancel event
                        //AlertBox(getApplicationContext(),"login","On Cancel");
                        Log.v("Error","On cancel");
                    }

                    @Override
                    public void onComplete(Bundle values) {
                        // Function to handle complete event
                        // Edit Preferences and update facebook acess_token
                        SharedPreferences.Editor editor = mPrefs.edit();
                        editor.putString("access_token",fb.getAccessToken());
                        editor.putLong("access_expires",fb.getAccessExpires());
                        editor.commit();
                        getProfileInformation();
                    }

                    @Override
                    public void onError(DialogError error) {
                        //AlertBox(getApplicationContext(),"login","On Error");
                        Log.v("Error","On error");

                    }

                    @Override
                    public void onFacebookError(FacebookError fberror) {
                        // Function to handle Facebook errors
                        Log.v("Error","facebook error");
                    }

                });
    }
    else
    {
        Log.v("Swssion","valid");
         getProfileInformation();
    }

}


@SuppressWarnings("deprecation")
public void logoutFromFacebook() {
    mAsyncRunner.logout(this, new RequestListener() {
        @Override
        public void onComplete(String response, Object state) {
            Log.d("Logout from Facebook", response);
            if (Boolean.parseBoolean(response) == true) {
                // User successfully Logged out

            }
        }

        @Override
        public void onIOException(IOException e, Object state) {
            Log.v("Error",e.toString());
        }

        @Override
        public void onFileNotFoundException(FileNotFoundException e,
                Object state) {
            Log.v("Error",e.toString());
        }

        @Override
        public void onMalformedURLException(MalformedURLException e,
                Object state) {
            Log.v("Error",e.toString());
        }

        @Override
        public void onFacebookError(FacebookError e, Object state) {
            Log.v("Error",e.toString());
        }
    });
}



@SuppressWarnings("deprecation")
public void getProfileInformation() {

    Log.v("getprofile","ok");
    mAsyncRunner.request("me", new RequestListener() {
        String name,email,fname="",lname="",fbid="";
        @Override
        public void onComplete(String response, Object state) {


            Log.d("Profile", response);
            String json = response;
            try {
                JSONObject profile = new JSONObject(json);
                // getting name of the user
                 name = profile.getString("name");
                // getting email of the user
                 email = profile.getString("email");

                 fname = profile.getString("first_name");
                 lname = profile.getString("last_name");
                 fbid = profile.getString("id");
                 Log.v("data",profile.toString());

            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

        @Override
        public void onIOException(IOException e, Object state) {
            Log.v("err","ioexception");
        }

        @Override
        public void onFileNotFoundException(FileNotFoundException e,
                Object state) {
            Log.v("err","file not found exception");
        }

        @Override
        public void onMalformedURLException(MalformedURLException e,
                Object state) {
            Log.v("err","mal form url exception");
        }

        @Override
        public void onFacebookError(FacebookError e, Object state) {
            Log.v("err","facebook err exception");
        }
    });
}
</code></pre>
