How to logout and signin with another facebook account

I use the facebook app's SingleSignOn dialog to login, but I can't clear the cache of the facebook app. So when I try to use another facebook account to login, it will login automatically with the previous account.

What can I do ?

public String logout(Context context) throws MalformedURLException, IOException {
    Bundle b = new Bundle();
    b.putString("method", "auth.expireSession");
    String response = request(b);
    return response;


You have to use AsyncRunner.logout() method. Take a look at example.

Need Your Help

How to search a file for a pattern and get a new file from the match point to end of file?

perl unix sed file-processing

I need to take a file and find the first occurrence of a literal string pattern as a complete line of the file:

registerOnSharedPreferenceChangeListener not working for changes made in different process

android process sharedpreferences

I have registered registerOnSharedPreferenceChangeListener with my SharedPreferences in my Activity. When I change the data saved with SharedPreferences inside service running in different process,