の一部を更新し、それがTextViewのボタンです:私は、ログイン画面の15%を持っている私の活動で活動
<TextView
android:id="@+id/registered_text"
android:color = "@color/white"
android:layout_width="wrap_content"
android:textSize="20dip"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
></TextView>
<Button
style="@style/myButton"
android:id="@+id/reg_button"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="10dip"
android:layout_height="wrap_content"
>
</Button>
のTextView値とボタンのテキストとリスナーがユーザーに依存します登録されているかどうか:
loginDB login = new loginDB(context);
Cursor cursor = login.logData(new String[]{"userJoomla", "idUSER", "name","email"});
if (cursor.moveToFirst()) {
userJoomla = cursor.getInt(0);
userID = cursor.getInt(1);
name = cursor.getString(2);
email = cursor.getString(3);
greeting.setText("Hola " + name);
loginLogout.setText("Desconectarme");
loginLogout.setOnClickListener(logout);
} else {
name = "usuario móvil";
greeting.setText("");
loginLogout.setText("Identificarme");
loginLogout.setOnClickListener(newLogin);
}
login.close();
ユーザーのログイン時またはログアウト時にどのように更新できますか?
ありがとうございました
上のフラグメントを使用するCompatibility Libraryを使用しますか?画面全体を入れ替えたいですか? –