In my Activity
, I have a FrameLayout
inside a SwipeRefreshLayout
, like this:
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/filter_list_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"></FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout>
I replace the FrameLayout
with a Fragment
which contains a ListView
, like this:
<?xml version="1.0" encoding="utf-8"?>
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/list"
android:layout_gravity="center_horizontal"
android:scrollbarStyle="outsideOverlay"
android:divider="#d3d3d3"
android:dividerHeight="2dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:background="@android:color/white"
android:clipToPadding="false"/>
The problem that when I scroll down, the ListView
doesn't scroll. Instead, the Pull to Refresh indicator is launched.
Any ideas? I know I could set a OnScrollListener
in the ListView
but I cannot access the SwipeRefreshLayout
from the Fragment
that contains the ListView
.
Any ideas? Thanks