Textview をヘッダーとして使用していますが、ListView アイテム行を使用して選択したアイテムの名前を取得していません。アプリを実行するたびに、最初のリストビューにヘッダーのテキストとしてメニューが表示されます。選択したアイテムのタイトルの代わりにヘッダーとして「タイトル」を取得しています。不足している場所を確認してください:-
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);