-1

I have adding "pulltorefresh" library using this site https://github.com/johannilsson/android-pulltorefresh/tree/master/pulltorefresh working perfectly. But when first time there is no date in listview using below component(No data) and pull the view but no refresh start(i know there is no data).How to handle this sitution if no data in list.

<com.markupartist.android.widget.PullToRefreshListView
        android:id="@+id/pullview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:cacheColorHint="@android:color/transparent"
        android:divider="#19000000"
        android:dividerHeight="1dp"
        android:fadingEdge="none"
        android:fastScrollEnabled="false"
        android:footerDividersEnabled="false"
        android:headerDividersEnabled="false"
        android:smoothScrollbar="true" />

How to blank view and pulltorefresh start when user swipe top to bottom?

How to perform pullto refresh view automatically (Without tap)any method exists in this library?

Sanket990
  • 665
  • 1
  • 10
  • 22

2 Answers2

0

How to handle this sitution if no data in list.

Simplest approach is to put your ListView into i.e. RelativeLayout and add additional overlay over it with "No data" view. If you got no data you hide list and show that overlay layout. If you got data to list, overlay view is gone and list shines.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
0

while i dont know the pull to refresh implementaton you use. i suggest to use the one provided by the android support library.

here you find the official javadoc and here is a short tutorial on how to use it.

and another sample you can find in your sdk directory %ANDROID_HOME\extras\android\support\samples\Support4Demos\src\com\example\android\supportv4\widget\SwipeRefreshLayoutActivity.java

Dodge
  • 8,047
  • 2
  • 30
  • 45
  • Thanks, i know SwipeRefreshLayoutActivity but in this class how to change header swipe (Loading) change pulltorefresh style set .means progress bar set in view header center – Sanket990 Nov 06 '14 at 07:25
  • 1
    then you might try https://github.com/chrisbanes/ActionBar-PullToRefresh the developer, chris banes is now at google, working on stuff for the support library. the libray states that it is deprecated, but only as there is now the official one. – Dodge Nov 06 '14 at 07:28