Android SharedPreference.Iで少し助けが必要です。ログインしていればユーザー状態を保存する方法を探そうとしていました。 - TAB2 - TAB3Androidのユーザーログインログアウト状態を保存する
TAB1 - >
TAB1:いくつかのタブと、ログインページが含まtabhostを持ってelse.I何かがActivities.Hereが少し例である子の1から開始されましたACT1(TAB1の子アクティビティ) ACT1 --->ログインページ。
私はSharedPreferencesを使用してisLoggedIn状態を取得しますが、TAB1が新しい要素を表示できるように、ログインページを閉じるときにUIをリロードしたいという問題があります。ここで
は、今の私のコードです:
ログインページ:
SharedPreferences isLogged = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = isLogged.edit();
editor.putBoolean("isLoggedIn", true);
editor.commit();
this.notifyAll();
とTAB1に、私はこの持っている:それを修正する方法
SharedPreferences isLogged = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
boolean isLoggedIn = isLogged.getBoolean("isLoggedIn", false);
任意のアイデアを?