Я получил ListActivity
, каждый элемент имеет 2 изображения в текстовом изображении и CheckedTextView
. Я пытаюсь реализовать простой multichoiselist ... У меня есть две проблемы: 1.onListItemClick и CheckedTextView не respoding
@Override
protected void onListItemClick(android.widget.ListView l, View v,
int position, long id)
{
...
}
оленья кожа реагировать на все, что я пробовал его с помощью отладчика и при нажатии на любой элемент списка оно не останавливаться на достигнутом. и я пробовал все виды вещей (например, focusable:false
)
2 :. В любом случае я не могу переключить CheckedTextView
.
вот мой 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="100sp"
android:focusable="false" android:focusableInTouchMode="false">
android:padding="6dip">
<ImageView android:layout_width="wrap_content"
android:layout_height="fill_parent" android:src="@drawable/icon"
android:id="@drawable/icon" android:layout_marginLeft="6dip"
android:focusable="false" android:focusableInTouchMode="false">
</ImageView>
<LinearLayout android:id="@+id/LinearLayout01"
android:orientation="vertical" android:layout_width="1sp"
android:layout_height="fill_parent" android:layout_weight="1"
android:focusable="false" android:focusableInTouchMode="false">
<TextView android:id="@+id/toptext" android:layout_weight="1"
android:gravity="center_vertical" android:text="OrderNum"
android:singleLine="true" android:layout_height="0dp"
android:layout_width="wrap_content" android:focusable="false"
android:focusableInTouchMode="false">
</TextView>
<TextView android:id="@+id/bottomtext" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:focusable="false"
android:focusableInTouchMode="false" android:text="TweetMsg">
</TextView>
<TextView android:id="@+id/twittLocation"
android:layout_weight="1" android:text="location" android:singleLine="true"
android:layout_width="fill_parent" android:layout_height="0dip"
android:focusable="false" android:focusableInTouchMode="false">
</TextView>
<TextView android:layout_weight="1" android:id="@+id/twittLocationlink"
android:text="locationlink" android:gravity="fill_horizontal"
android:layout_width="fill_parent" android:layout_height="0dip"
android:focusable="false" android:focusableInTouchMode="false">
</TextView>
</LinearLayout>
<CheckedTextView android:id="@android:id/text1" android:text="Delete"
android:layout_width="wrap_content" android:layout_marginRight="2dp"
android:layout_height="fill_parent"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:focusable="false"></CheckedTextView>
</LinearLayout>
любая идея, что проблема? спасибо.
Используйте 'LogCat' и оставить отладочные операторы внутри кода, чтобы увидеть, если его регистрации. Как только вы это сделаете, откройте окно перспективы LogCat и посмотрите, что происходит внутри окна. –
Что я должен искать в logcat? там ничего не написано, что касается моей проблемы, что нужно зарегистрировать? мог бы быть более конкретным, пожалуйста – rayman
Это может быть отдельной проблемой, которая была рассмотрена здесь ранее. Сделайте поиск SO, чтобы «сообщения logcat не отображались» или что-то в этом роде. – MatrixFrog