リスト フラグメントを拡張するクラスがありますが、何らかの理由でフラグメントがリスト アイテムのクリックを受信していません。問題を行項目に絞り込みましたが、まだ何が問題なのかわかりません。これが私のXMLです。何か案は?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:focusable="true">
<ImageButton
android:id="@+id/image_button"
android:layout_width="120px"
android:layout_height="120px"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"/>
カスタム アダプターでこのレイアウトを拡張する方法は次のとおりです。
public View getView(int position, View convertView, ViewGroup parent){
LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = vi.inflate(R.layout.list_item, parent, false);
T t = list.get(position);
TextView tv1 = (TextView) view.findViewById(R.id.text_view1);
tv1.setText(t.getName());
ImageButton image= (ImageButton) view.findViewById(R.id.image_button);
image.setBackgroundColor(Color.parseColor("blue"));
return view;
}