0

listView の単純な行にあるアイテムの複数のイベントを処理するにはどうすればよいですか? 例: リストビューの各行には、表示用と編集用の 2 つのボタンがあります。

xml の onclick 属性にメソッド名を入力したところ、次のエラーが発生しました。

java.lang.IllegalStateException: Could not find a method methodName in the 
activity class android.app.Application for onClick handler on view class 
android.widget.ImageButton 

私のリスト行

<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/timeOrder"/>

<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/phoneNumberOrden"/>

<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/nameOrder"/>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <ImageButton 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_menu_view"
        android:contentDescription="@string/contentDescription"
        android:onClick="details"
        />

    <ImageButton 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_menu_call"
        android:contentDescription="@string/contentDescription"
        android:onClick="call"
        />

</LinearLayout>

4

0 に答える 0