私は次のImageButton
ような子xmlレイアウトを持っています:
<ImageButton
android:id="@+id/favoriteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/citrus_orange"
android:paddingLeft="@dimen/feed_item_padding_left_right"
android:background="@null"
andorid:onClick="flipVote"/>
アダプターでこのボタンをプログラムでフォーカス不可にします。
ImageButton favButton = (ImageButton) convertView.findViewById(R.id.favoriteButton);
favButton.setFocusable(false);
同じレイアウトで、次のTextView
ようなものがあります。
<TextView
android:id="@+id/store_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
クリックするとflipVote(View view)
メソッドが呼び出されます。
public void flipVote(View view) {
// make a network call with the value from store_id
}
TextView
クリックされたボタンに関連付けられたから値を取得して、ネットワーク呼び出しに含めるにはどうすればよいですか?