开发者

problem in listview not clickable

Hello i a probleme i use getListView(); for my list1 and i would like use a second list view (this separating by tab)

My fist listview

<ListView
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

/>

For my second listview I is not found another solution, i use id

<ListView
    android:id="@+id/list2"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

/>

the problem is when use

((ListView)findViewById(R.id.list2)).setOnScrollListener(new OnScrollListener(){...

The listview is not clickable, the first listview good work !

When i use

getListView().setOnScrollListener(new OnScrollListener(){...

(already used for listview list1 i know..) the listview 2 is clickable but the setOnScrollListener for the list 1 doesn't work ...开发者_如何学Go.

how use two getListView() or fixed this ? Thanks


Do you really want onScrollListener? or did you want onItemClickListener? in either case, there is no reason something like this shouldn't work:

ListView lv1=(ListView) findViewById(R.id.list1);
ListView lv2=(ListView) findViewById(R.id.list2);

lv1.setOnItemClickListener(new OnItemClickListener(){...
lv1.setOnScrollListener(new OnScrollListener(){...

lv2.setOnItemClickListener(new OnItemClickListener(){...
lv2.setOnScrollListener(new OnScrollListener(){...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜