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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:19:05+00:00 2026-06-07T16:19:05+00:00

I’ve built a custom CursorAdapter that needs to populate a ListView with tweets… Just

  • 0

I’ve built a custom CursorAdapter that needs to populate a ListView with tweets… Just simple date and tweet will be shown…
It works great, the only thing is that if I add a Log entry I notice that the BindView method is getting called continuously every 8 seconds for every item…Which corresponds with a ViewFlipper’s flipDuration elsewhere on the screen…(Verified by changing the duration and seeing BindView being called with the new interval times)

The ViewFlipper does use the same layout xml as the ViewList and the same data (though I make 2 separate calls to the DB to load them in)

Is this normal behaviour?

Method that renders the List and Flipper:

public void loadTwitterFeed(){

    ListView twitterList = (ListView) findViewById(R.id.twitterList);

    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    dbHelper dbh = new dbHelper(this);

    dbh.openRead();

    twitterDbAdapter adapt = new twitterDbAdapter(this, dbh.getTweets());

    twitterList.setAdapter(adapt);

    ViewFlipper flipper = (ViewFlipper) findViewById(R.id.twitterFlipper);

    ArrayList<twitterTweet> tweets = dbh.getTweetsAsList();

    for( twitterTweet obj : tweets){

        View tItem = (View) inflater.inflate(R.layout.twitter_item, flipper, false);

        TextView tv1 = (TextView) tItem.findViewById(R.id.textView1);
        TextView tv2 = (TextView) tItem.findViewById(R.id.textView2);

        tv1.setText(obj.getDate());
        tv2.setText(obj.getText());

        flipper.addView(tItem);

    }

    dbh.close();

    flipper.setFlipInterval(5000);
    flipper.setInAnimation(AnimationUtils.loadAnimation(this,android.R.anim.slide_in_left));
    flipper.setOutAnimation(AnimationUtils.loadAnimation(this,android.R.anim.slide_out_right));
    flipper.startFlipping();

}

My custom adapter:

public class twitterDbAdapter extends CursorAdapter{
private LayoutInflater inflater;

public twitterDbAdapter(Context context, Cursor cursor){

    super(context, cursor);
    inflater = LayoutInflater.from(context);
}

@Override
public void bindView(View view, Context context, Cursor cursor) {
    Log.i("extra","binding");
    TextView textView = (TextView) view.findViewById(R.id.textView1);
    TextView textView2 = (TextView) view.findViewById(R.id.textView2);

    textView.setText(cursor.getString(cursor.getColumnIndex("createdat")));
    textView2.setText(cursor.getString(cursor.getColumnIndex("tweet")));

}

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    View view = inflater.inflate(R.layout.twitter_item, parent, false);
    return view;
}

}
  • 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-07T16:19:07+00:00Added an answer on June 7, 2026 at 4:19 pm

    It works great, the only thing is that if I add a Log entry I notice
    that the BindView method is getting called continuously every 8
    seconds for every item

    I doubt that bindView is called for all the items in the ListView, most likely the method is called for the visible items(plus a few extra calls).

    As the ViewFillper flips through it’s children Android needs to re-layout the current screen content, this is probably the cause for your bindView method being called at the ViewFlipper‘s switching interval. It shouldn’t matter for you.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.