私はxmlからビューを膨らませてレイアウトに追加しました:
View header = LayoutInflater.from(this).inflate(R.layout.lenta_parent_item,(FrameLayout)findViewById(R.id.frameContent), false);
header.setOnClickListener(new OnClickListener() {
public void onClick(View header) {
...some code
}
});
メイン レイアウト xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/frameContent">
<view ....
</FrameLayout>
アプリを実行すると、このビュー (「ヘッダー」) が表示されますが、クリックしても何も起こりません。イベントが発生していません。ビューのクリック イベントを取得するにはどうすればよいですか?