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 9193075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:04:31+00:00 2026-06-17T21:04:31+00:00

I have successfully integrated a pulltorefresh listview to my actual code. However, when the

  • 0

I have successfully integrated a pulltorefresh listview to my actual code.

However, when the list get updated it adds all the rows that exist to the end of the list. I come to the idea to clear all the list element before making the updates but i am stick on

how to remove these rows inside the listview. The row item are cacheable element i think something like clear cache can work ? Any idea please. I want to get rid of the listview rows.

<com.dmobile.pulltorefresh.PullRefreshContainerView
    android:id="@+id/container"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:dividerHeight="2dp"
    android:scrollingCache="false"
    android:listSelector="@drawable/list_selector"
    />

Here’s my efficient adapter

            EfficientAdapter efficienadapter=new EfficientAdapter(Actualites.this,result);
            //EfficientAdapter.isActusAstuce=true;
            mList.setAdapter(efficienadapter);

this is my oncreate method

mRefreshHeader = new TextView(this);

        mImage= new ImageView(this);

        mRefreshHeader.setTextSize(TypedValue.COMPLEX_UNIT_SP,16);

        mRefreshHeader.setTypeface(null, Typeface.BOLD);

        mRefreshHeader.setTextColor(getResources().getColor(R.color.blue));

        mRefreshHeader.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,

LayoutParams.MATCH_PARENT));

        mRefreshHeader.setGravity(Gravity.CENTER);

        mRefreshHeader.setText("Pull to refresh...");


        mImage.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

      //  LinearLayout.LayoutParams params=new LinearLayout.LayoutParams
           //     ((int)LayoutParams.WRAP_CONTENT,(int)LayoutParams.WRAP_CONTENT);

       // params.leftMargin=50;

       // mImage.setLayoutParams(params);

        int id = getResources().getIdentifier("boutton_retour", "drawable", getPackageName());

        //mImage.setImageResource(id);   

        mContainerView = (PullRefreshContainerView) findViewById(R.id.container);

        mContainerView.setRefreshHeader(mRefreshHeader);

        mContainerView.setRefreshHeader(mImage);

        mContainerView.setOnChangeStateListener(new OnChangeStateListener() {

            @Override

            public void onChangeState(PullRefreshContainerView container, int 

state) {
switch(state) {

                case PullRefreshContainerView.STATE_IDLE:

                case PullRefreshContainerView.STATE_PULL:

                    mRefreshHeader.setText("Tirez pour actualiser...");

                    break;

                case PullRefreshContainerView.STATE_RELEASE:

                    mRefreshHeader.setText("Relâchez pour rafraîchir...");

                    break;

                case PullRefreshContainerView.STATE_LOADING:

                    mRefreshHeader.setText("Chargement en cours...");

                    new Thread(new Runnable() {

                        @Override

                        public void run() {
                            Actualites.this.runOnUiThread(new Runnable() {

                                @Override

                                public void run() {

                                    try {

                                        Thread.sleep(2000);

                                    } catch 

(InterruptedException e) {

        e.printStackTrace();
                                    }
                                    //refresh ui

                                    new loadingTask().execute("");


                                    mContainerView.completeRefresh();
                                }
                            });

                        }


                    }).start();

                    break;

                }

            }

        });


        mList = mContainerView.getList();

        mList.setCacheColorHint(Color.TRANSPARENT);

        // PostList for ListView

        /// START AsyncTask here

        new loadingTask().execute("");


  note       new loadingTask().execute("") is an async background task
  • 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-17T21:04:32+00:00Added an answer on June 17, 2026 at 9:04 pm

    firstly, clear the result array/ arrayList or list, …
    after that, notify the adapter to sync list item

    result.clear();
    efficienadapter.notifyDataSetChanged();
    

    hope this help

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

Sidebar

Related Questions

So I have successfully integrated Zxing into my application. However I want to make
I believe that I have successfully integrated jQuery UI Bootstrap with Rails thanks to
I have successfully integrated PayPal. All is working fine. But I want my form
I have successfully created a feature in sharepoint that modifies the existing edit dialog
I have successfully migrated all my databases from 2008 to 2012 and mapped the
I have successfully installed Eclipse and the Android SDK on Fedora 16. However, when
I have successfully integrated android childbrowser plugin in cordova 1.9.0. Now i want to
I have successfully integrated the Silent Post feature with our system for ARB subscriptions.
I have successfully integrated the three20 framework in my project, and I have extended
I am developing an Intranet application and have successfully integrated with Active Directory. When

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.