Android 长时间单击不';t工作(使用下推刷新库)

Android 长时间单击不';t工作(使用下推刷新库),android,push,Android,Push,因为我使用的是chrisbanes库,所以我不得不删除普通的listview并用新的listview替换它。但在这之后,长时间推送listview项就不起作用了,而且总是会死灰复燃。信息似乎总是返回空值,因为他没有得到信息,我实际上点击的是什么,这是不好的。我一直想自己修,但没有成功。。感谢您的帮助 xml布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="htt

因为我使用的是chrisbanes库,所以我不得不删除普通的listview并用新的listview替换它。但在这之后,长时间推送listview项就不起作用了,而且总是会死灰复燃。信息似乎总是返回空值,因为他没有得到信息,我实际上点击的是什么,这是不好的。我一直想自己修,但没有成功。。感谢您的帮助

xml布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >


<ProgressBar
    android:id="@+id/loadingbar"
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:visibility="gone" />

<TextView
    android:id="@+id/loading_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:text="Loading... Hang in there!"
    android:visibility="gone" />

 <com.handmark.pulltorefresh.library.PullToRefreshListView
android:id="@+id/animelist"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />

另外,我使用的是自定义适配器,在这里我存储关于每个listitem行项目的所有信息,我需要在longpush中使用这些信息。

遗憾的是,没有人提供帮助

好吧,经过几个小时的研究,我找到了解决办法,这是一件非常简单的事情。我希望它能指导将来有同样问题的人

基本上,我创建了空的ListView,并将我的pushDownListView的所有值都赋予它。之后,我注册了create函数。几行代码:

pullToRefreshView = (PullToRefreshListView) findViewById(R.id.animelist);
        ListView lv1 = pullToRefreshView.getRefreshableView();

    registerForContextMenu(lv1);

    lv1.setAdapter(anime_list_adapter);

    registerForContextMenu(lv1);

可惜没有人帮忙

好吧,经过几个小时的研究,我找到了解决办法,这是一件非常简单的事情。我希望它能指导将来有同样问题的人

基本上,我创建了空的ListView,并将我的pushDownListView的所有值都赋予它。之后,我注册了create函数。几行代码:

pullToRefreshView = (PullToRefreshListView) findViewById(R.id.animelist);
        ListView lv1 = pullToRefreshView.getRefreshableView();

    registerForContextMenu(lv1);

    lv1.setAdapter(anime_list_adapter);

    registerForContextMenu(lv1);

谢谢大家。我喜欢你的解决方案:)干杯!谢谢大家。我喜欢你的解决方案:)干杯!