title: Android save user login logout state
body: <p>I need a little help again with Android SharedPreference.I was earching for a way to save the user state if he is logged in or not..So I did this part, but now the problem is something else.I have a tabhost which include a few tabs and the Login page is started from one of the child Activities.Here is a little example :</p>
  
  <blockquote>
    <p>TAB1   -   TAB2   -   TAB3 </p>
    
    <p>TAB1  --> ACT1 (child activity of TAB1)
    ACT1 ---> Login Page.</p>
  </blockquote>
  
  <p>So I'm using SharedPreferences to get and set the isLoggedIn states,but the problem is that I want to reload the UI when I close the Login Page, so TAB1 can show the new element.</p>
  
  <p>Here is my code for now :</p>
  
  <p>Login Page :</p>
  
  <pre><code>SharedPreferences isLogged = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
          SharedPreferences.Editor editor = isLogged.edit();
          editor.putBoolean("isLoggedIn", true);
          editor.commit();
          this.notifyAll();
  </code></pre>
  
  <p>and in TAB1  I have this :</p>
  
  <pre><code>SharedPreferences isLogged = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
          boolean isLoggedIn = isLogged.getBoolean("isLoggedIn", false);
  </code></pre>
  
  <p>Any idea how to fix that?</p>