I'm trying to implement chrisbanes's Android-PullToRefresh in my app. But so far all I'm getting is an empty view. If I change the ListView to an Android widget it works fine, if I use PullToRefreshListView the list shows up empty. I'm using a custom ListAdapter.
Here's the XML part:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical" >
<com.handmark.pulltorefresh.library.PullToRefreshListView
android:id="@+id/listview_jogos"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null" >
</com.handmark.pulltorefresh.library.PullToRefreshListView>
</LinearLayout>
Here is the code in the activity (it's being called, at least according to the debug information):
private void constroiLista(ArrayList<Jogo> lista)
{
PullToRefreshListView lv = (PullToRefreshListView)findViewById(R.id.listview_jogos);
if(lv != null && lista != null)
{
lv.setAdapter(new ListAdapter(this, lista));
lv.setOnRefreshListener(new OnRefreshListener<ListView>()
{
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView)
{
(dnt = new DownloadJogosTask()).execute();
}
});
// Call onRefreshComplete when the list has been refreshed.
lv.onRefreshComplete();
}
}
And if it makes a difference the layout containing this listview is being inflated into a base one:
((LinearLayout)findViewById(R.id.ll_base_layout)).addView(View.inflate(this, R.layout.lista_jogos, null));
Is there any known bugs associated with this library? I searched around but haven't found anything similar. Thanks in advance for your help :)