【发布时间】:2012-10-18 09:59:34
【问题描述】:
我使用 Textview 作为标题,但没有使用 ListView 项目行获取所选项目的名称,每当我运行我的应用程序时,第一个列表视图将菜单显示为标题中的文本,因为我在 xml 中给出,但在第二个活动的标题中我只将“标题”作为标题而不是选定项目标题,请查看我缺少的地方:-
header.xml
<TextView
android:id="@+id/actionbar"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:background="@drawable/header"
android:gravity="center_vertical|center_horizontal"
android:shadowColor="@android:color/black"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:text="Menu"
android:textColor="#FFFFFF"
android:textSize="25dp"
android:textStyle="bold" />
代码:-
static final String KEY_TITLE = "title";
@Override
protected void onPostExecute(ArrayList<HashMap<String, String>> result) {
TextView lblTitle = (TextView) findViewById(R.id.actionbar);
lblTitle.setText(KEY_TITLE);
【问题讨论】:
标签: android android-widget android-listview