Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9041725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:18:27+00:00 2026-06-16T10:18:27+00:00

<?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical > <com.handmark.pulltorefresh.library.PullToRefreshScrollView xmlns:ptr=http://schemas.android.com/apk/res-auto android:id=@+id/pull_refresh_scrollview android:layout_width=fill_parent android:layout_height=fill_parent

  • 0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <com.handmark.pulltorefresh.library.PullToRefreshScrollView
        xmlns:ptr="http://schemas.android.com/apk/res-auto"
        android:id="@+id/pull_refresh_scrollview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <ExpandableListView
        android:id="@+id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/black" />

    <TextView
        android:id="@+id/android:empty"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="No items"
        android:textColor="@color/White" />

    </com.handmark.pulltorefresh.library.PullToRefreshScrollView>

</LinearLayout>

This is my XML Layout file to which I am using the chrisbanes pull to refresh library here

For some Reason it will only show the first in the Expandable List of the Clickable items, and when I click on it it does not expand the row, I have been playing around with this and am confused as to why this is happening, here is the code for the Fragment Class

public class TestExpandFragment extends ExpandableListFragment {

    private String[] divideOptions = { "Test1", "Test2", "Test3", "Test4",
            "Test5", "Test6", "Test7", "Test8" };

    PullToRefreshScrollView mPullRefreshScrollView;
    ScrollView mScrollView;

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        try {

            SimpleExpandableListAdapter expListAdapter = new SimpleExpandableListAdapter(
                    getActivity(), createGroupList(), // Creating group List.
                    R.layout.group_row, // Group item layout XML.
                    new String[] { "1" }, // the
                                            // key
                                            // of
                                            // group
                                            // item.
                    new int[] { R.id.row_name }, // ID of each group item.-Data
                                                    // under the key goes into
                                                    // this TextView.
                    createChildList(), // childData describes second-level
                                        // entries.
                    R.layout.group_child_row, // Layout for sub-level
                                                // entries(second
                    // level).
                    new String[] { "Sub Item" }, // Keys in childData maps to
                                                    // display.
                    new int[] { R.id.grp_child } // Data under the keys above go
                                                    // into these TextViews.
            );
            setListAdapter(expListAdapter); // setting the adapter in the list.

        } catch (Exception e) {
            System.out.println("Errrr +++ " + e.getMessage());
        }

        View view = inflater.inflate(R.layout.test_expandable_fragment, container,
                false);

        /** Implement Pull To Refresh **/
        mPullRefreshScrollView = (PullToRefreshScrollView) view
                .findViewById(R.id.pull_refresh_scrollview);
        mPullRefreshScrollView
                .setOnRefreshListener(new OnRefreshListener<ScrollView>() {

                    @Override
                    public void onRefresh(
                            PullToRefreshBase<ScrollView> refreshView) {

                        new GetDataTask().execute();

                    }

                });

        mScrollView = mPullRefreshScrollView.getRefreshableView();

        return view;
    }

    /* Creating the Hashmap for the row */
    @SuppressWarnings("unchecked")
    private List createGroupList() {
        ArrayList result = new ArrayList();
        for (int i = 0; i < 8; ++i) { // 8 groups........
            HashMap m = new HashMap();
            m.put("1", divideOptions[i]); // the key and it's value.
            result.add(m);
        }
        return (List) result;
    }

    /* creatin the HashMap for the children */
    @SuppressWarnings("unchecked")
    private List createChildList() {

        ArrayList result = new ArrayList();
        for (int i = 0; i < 15; ++i) { // this -15 is the number of groups(Here
                                        // it's fifteen)
            /*
             * each group need each HashMap-Here for each group we have 3
             * subgroups
             */
            ArrayList secList = new ArrayList();
            for (int n = 0; n < 3; n++) {
                HashMap child = new HashMap();
                child.put("Sub Item", "Sub Item " + n);
                secList.add(child);
            }
            result.add(secList);
        }
        return result;
    }

    public void onContentChanged() {
        System.out.println("onContentChanged");
        super.onContentChanged();
    }

    /* This function is called on each child click */
    public boolean onChildClick(ExpandableListView parent, View v,
            int groupPosition, int childPosition, long id) {
        System.out
                .println("Inside onChildClick at groupPosition = "
                        + groupPosition + " Child clicked at position "
                        + childPosition);
        return true;
    }

    /* This function is called on expansion of the group */
    public void onGroupExpand(int groupPosition) {
        try {
            System.out.println("Group exapanding Listener => groupPosition = "
                    + groupPosition);
        } catch (Exception e) {
            System.out.println(" groupPosition Errrr +++ " + e.getMessage());
        }
    }

    /** Sleeper for the PullToRefresh **/
    private class GetDataTask extends AsyncTask<Void, Void, String[]> {

        @Override
        protected String[] doInBackground(Void... params) {
            // Simulates a background job.
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }
            return null;
        }

        @Override
        protected void onPostExecute(String[] result) {
            // Do some stuff here

            // Call onRefreshComplete when the list has been refreshed.
            mPullRefreshScrollView.onRefreshComplete();

            super.onPostExecute(result);
        }
    }

}

If anyone could maybe tell me why this is Happening as it will only output the Test1 but with no action, the pull to refresh will be there on load, and if I take away the pull to refresh, it does work, and I have used it surrounding other types of Layouts before with other code and have never come across this, maybe it’s something silly, I’m not sure, but I figured maybe someone could see the problem quicker.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T10:18:28+00:00Added an answer on June 16, 2026 at 10:18 am

    I’ve never used that library, but in general you can’t put a ListView inside a ScrollView (think about it). Looking at the library classes though, you should try to use the PullToRefreshExpandableListView instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Main.xml <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent > <Spinner android:layout_width=wrap_content android:layout_height=wrap_content android:id=@+id/spin
This is my code: <?xml version=1.0 encoding=utf-8?> 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=horizontal <EditText
<?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:id=@+id/linearLayout android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent android:gravity=center_horizontal android:background=@color/background_color> <TextView android:id=@+id/titleTextView
I have this XML: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:ads=http://schemas.android.com/apk/lib/com.google.ads android:id=@+id/LinearLayout1 android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/fondoverde3
I use TableLayout with android. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <TableLayout
I have a base.xml view: <?xml version=1.0 encoding=utf-8?> <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=horizontal
The activity_main.xml is like this <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 > <Button android:id=@+id/button_one_activity_one android:layout_width=match_parent
i am doing a application with this main.xml layout : <?xml version=1.0 encoding=utf-8?><LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following the layout file <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:app=http://schemas.android.com/apk/res/com.company android:layout_width=fill_parent
I have a fragment with the following layout: my_fragment.xml <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.