我使用this Pull-to-Refresh,它有效,但安装后无法调用listView的标准函数,例如:
public static RefreshableListView lv = (RefreshableListView) findViewById(R.id.messageListView); //this work
lv.setOnItemLongClickListener(longClickListener); //don`t work
lv.setSelection(listViewCountPosition); //don`t work
Parcelable state = lv.onSaveInstanceState(); //don`t work
lv.onRestoreInstanceState(state); //don`t work
编译器写入错误。
答案 0 :(得分:1)
RefreshableListView实现了FrameLayout(不是listview)。 Listview作为子项添加到FrameLayout。您必须为列表视图实例调用getListView()。
像这样...... public RefreshableListView lv = (RefreshableListView) findViewById(R.id.messageListView);
lv.getListView().setOnItemLongClickListener(longClickListener);