我在 https://github.com/47deg/android-swipelistview 中使用了 android-swipelistview,但我无法实现 OnItemClickListener。我写的时候它没有运行:

swipeListView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
            startActivity(new Intent(getActivity().getApplicationContext(),ComposeActivity.class));
        }
    });

最佳答案

试试这个:

swipeListView.setSwipeListViewListener(new BaseSwipeListViewListener() {
    @Override
    public void onClickFrontView(int position) {
         super.onClickFrontView(position);
         your code...
    }
}

关于android - 无法在 android-swipelistview 中实现 OnItemClickListener,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20118147/

10-09 02:36