Skip to content Skip to sidebar Skip to footer

Android Pull-to-Refresh With ListView Fragment & Custom ListView Adapter

I built my project using the Android Studio start options (Automatically builds the action bar with the tabs) so a bit is generated for me. I did however implement a list-view frag

Solution 1:

Now android has introduced new simple featrure called Swipe to refresh layout. Please refer the site devloper site and a simple example


Solution 2:

Have you tried to follow this tutorial from Chris Banes: https://github.com/chrisbanes/ActionBar-PullToRefresh/wiki/QuickStart-ABS ?

This tutorial contains all steps, beginning from build.gradle and finishing with code snippets.

The only difference: tutorial is for ScrollView (not ListView as you wish). But don't be scared. Just replace ScrollView with ListView and everything should be OK.

UPDATE: you should see at this block especially:

<uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ptr_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Your content, here we're using a ScrollView -->

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ScrollView>

</uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshLayout>

you should not use com.lucaapp.app.PullToRefreshLayout instead of uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshLayout


Post a Comment for "Android Pull-to-Refresh With ListView Fragment & Custom ListView Adapter"