Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8563347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:56:24+00:00 2026-06-11T16:56:24+00:00

Need Help – I have some code for Logout like this public void logoutFromFacebook()

  • 0

Need Help – I have some code for Logout like this

public void logoutFromFacebook() {
    mAsyncRunner.logout(this, new RequestListener() {

        public void onComplete(String response, Object state) {
            Log.d("Logout from Facebook", response);
            if (Boolean.parseBoolean(response) == true) {
                runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    // Login button visible
                    btnFbLogin.setVisibility(View.VISIBLE);
                    // making all remaining buttons invisible
                    btnFbGetProfile.setVisibility(View.INVISIBLE);
                    btnPostToWall.setVisibility(View.INVISIBLE);
                    btnShowAccessTokens.setVisibility(View.INVISIBLE);
                    btnFbLogout.setVisibility(View.INVISIBLE);
                }
            });
        }
    }
}

But that code didnt work , when I click logout , and click login again , Im not input username and password again , I want if i click logout and when i click login again , i can input username and password again , Pleasee need solution , thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:56:25+00:00Added an answer on June 11, 2026 at 4:56 pm

    You have to use like this way when user press logout button you have to execute this code

      public void runTestLogout() {
        if (testLogout()) {
            logoutText.setText("Logout Tests Passed");
        } else {
            logoutText.setText("Logout Tests Failed");
        }
    }
    
    
    
     public boolean testLogout() {
        try {
            Log.d("Tests", "Testing logout");
            String response = authenticatedFacebook.logout(this);
            Log.d("Tests", "Got logout response: *" + response + "*");
            if (!response.equals("true")) {
                return false;
            }
    
            Log.d("Tests", "Testing logout on logged out facebook session");
            try {
                Util.parseJson(authenticatedFacebook.logout(this));
                return false;
            } catch (FacebookError e) {
                if (e.getErrorCode() != 101 || 
                        !e.getMessage().equals("Invalid API key") ) {
                    return false;
                }
            }
    
            Log.d("Tests", "Testing logout on unauthenticated object");
            try {
                Util.parseJson(new Facebook(APP_ID).logout(this));
                return false;
            } catch (FacebookError e) {
                if (e.getErrorCode() != 101 || 
                        !e.getMessage().equals("Invalid API key") ) {
                    return false;
                }
            }
    
            Log.d("Tests", "All Logout Tests Passed");
            return true;
        } catch (Throwable e) {
            e.printStackTrace();
            return false;
        }
    }
    

    The main thing is

      String response = authenticatedFacebook.logout(this);
    

    by running this code you will be logout now you can again log in and you will get empty username and password button

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need Help in converting this to VB.NET public void GetCustomers(Action<IEnumerable<Customer>> onSuccess, Action<Exception> onFail) {
need help in error in database pivot. i have table tamed table_score like below:
Need help. I have Graph API code that uses an auth token with offline
Need help with my simple PHP menu. I'd like to have something like that:
Need help on this following code. the problem is it only trigger the last
Need help figuring this out. I have two tables user ---- name skills (comma
Need help with this please. I need to save some data in session to
Need help parsing... In my code, I have a method that returns url.getHost();. But
Need help have no idea the thought process in doing this kind of simplification.
Need help pretty soon on this..... I have a Gridview in which the columns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.