在我的活动我有屏幕登录的15%的部分,它是一个TextView和一个按钮:刷新活动
<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();
如何在用户登录或注销时刷新它?
谢谢你提前
你想刷新什么用碎片?你想换掉整个屏幕吗? – 2012-03-20 15:56:18