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

  • Home
  • SEARCH
  • 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 3953628
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:59:52+00:00 2026-05-20T01:59:52+00:00

friends, i am using following tutorial to lazy load list view now problem is

  • 0

friends,

i am using following tutorial to lazy load list view

now problem is i cannot update if new data comes in any one guide me what mistake am i doing?
Lazy Load Tutorial

my changed code

public class MainActivity extends Activity {

    ListView list;
    LazyAdapter adapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        list=(ListView)findViewById(R.id.list);
        adapter=new LazyAdapter(this, mStrings,mValues);
        list.setAdapter(adapter);

        Button b=(Button)findViewById(R.id.button1);
        b.setOnClickListener(listener);
    }

    @Override
    public void onDestroy()
    {
        adapter.imageLoader.stopThread();
        list.setAdapter(null);
        super.onDestroy();
    }

    public OnClickListener listener=new OnClickListener(){
        @Override
        public void onClick(View v) {
            adapter.imageLoader.clearCache();
            ChangeData();
           // adapter=new LazyAdapter(MainActivity.this, mStrings,mValues);

            adapter.notifyDataSetChanged();
        }
    };

    public void ChangeData()
    {
        mValues = mValues1;
        mStrings = mStrings2;

    }

 private String[] mValues = {

            "670625317/aam-logo-v3-twitter.png",
            "740897825/AndroidCast-350_normal.png",
            "121630227/Droid_normal.jpg",
            "957149154/twitterhalf_normal.jpg"
 };


    private String[] mValues1 = {

            "670625317/aam-logo-v3-twitter.png",
            "740897825/AndroidCast-350_normal.png",
            "121630227/Droid_normal.jpg",
            "957149154/twitterhalf_normal.jpg",
            "97470808/icon_normal.png",
            "511790713/AG.png",
            "956404323/androinica-avatar_normal.png",
            "909231146/Android_Biz_Man_normal.png",


    };


    private String[] mStrings ={ "http://zef.me/wp-content/uploads/2008/02/funny-cat.jpg",
            "http://www.prchurch.com/data/43_800px-Bulgaria_stub.svg.png",
            "http://a3.twimg.com/profile_images/121630227/Droid_normal.jpg",
            "http://a1.twimg.com/profile_images/957149154/twitterhalf_normal.jpg"};


    private String[] mStrings2={
            "http://zef.me/wp-content/uploads/2008/02/funny-cat.jpg",
            "http://www.prchurch.com/data/43_800px-Bulgaria_stub.svg.png",
            "http://a3.twimg.com/profile_images/121630227/Droid_normal.jpg",
            "http://a1.twimg.com/profile_images/957149154/twitterhalf_normal.jpg",
            "http://a1.twimg.com/profile_images/97470808/icon_normal.png",
            "http://a3.twimg.com/profile_images/511790713/AG.png",
            "http://a3.twimg.com/profile_images/956404323/androinica-avatar_normal.png",
            "http://a1.twimg.com/profile_images/909231146/Android_Biz_Man_normal.png",
               };
}
  • 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-05-20T01:59:53+00:00Added an answer on May 20, 2026 at 1:59 am

    Probably something like that:

    public OnClickListener listener=new OnClickListener(){
        @Override
        public void onClick(View v) {
            adapter.mValues = mValues1;
            adapter.mStrings = mStrings2;
            adapter.notifyDataSetChanged();
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

friends, i am using following code to display list with radio buttons now i
I'm using the following code to retrieve the user's friends list and the info
Hi Friends i was using the following jquery,but it is not gaving an output
friends, i am using following code to get GPS location it is causing two
friends, i am using following global variables in my activity private String Session_ID; private
friends, i am using following code to write Serializable object to external storage. it
friends, i am using following custom adapter to show textview and checboxes in listview.
I'm using the following Facebook FQL query to fetch the relationships between my friends:
I am developing a website using CodeIgniter and PHP. Some of my friends suggest
Is there an ASP.NET AJAX framework other than just using UpdatePanel & Friends or

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.