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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:04:42+00:00 2026-05-25T02:04:42+00:00

I’m trying to implement android-viewFlow ( https://github.com/pakerfeldt/android-viewflow ) in my app, however, I’m having

  • 0

I’m trying to implement android-viewFlow (https://github.com/pakerfeldt/android-viewflow) in my app, however, I’m having hard time populating each page correctly.

The problem is that I have SQLite database, and I need to have a number of views that will match the number of rows matching my query (typically between 9 and 21), and each of those views should show values from that exact row.

In viewFlow, there’s this “sidebuffer” field that will load the number of views depending on what’s the value of this “sidebuffer”. So, how do I populate the adapter from SQLite and force the “sidebuffer” to match my number of rows. (If “sidebuffer = 3”, the views loaded will be 2 * 3 + 1, and if it’s 5, then it will load 2 * 5 + 1).

Is there a downside of having “sidebuffer = 100” hard-coded even if I will never have even near that much of views to be shown?

The reason I’m using viewFlow, and not the Android’s compatibility viewPager, is that I need the title indicator which is implemented.

Thanks in advance!

Right now, I’ve created a new method in viewFlow.java

public setSidebuffer(int sidebuffer) {
    mSideBuffer = sidebuffer;
    init();
}

and in my main_activity where I’m setting up the viewFlow I’m calling the method as follows:

viewFlow = (ViewFlow) findViewById(R.id.viewflow);
AndroidVersionAdapter adapter = new AndroidVersionAdapter(this);
viewFlow.setAdapter(adapter, 3);
viewFlow.setSidebuffer(adabter.getSize() / 2);    // THIS IS THE THING
  • 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-25T02:04:42+00:00Added an answer on May 25, 2026 at 2:04 am

    I’m afraid that setting a sidebuffer greater than the number of elements in your adapter might cause a FC. In that case, there’s a bug in android-viewflow I’ll have to look into. Anyway, such large sidebuffer will cause your adapter to create a View for each and every element, thus consuming, potentially a lot, memory. The whole idea with the adapter is to only load Views when needed.

    I think you’re approaching the problem from the wrong angle when you’re aiming on setting the complete buffer size to the size of your adapter. That’s not how it is meant to be used. Implement your adapter in such way that when getView(…) is called, the adapter will retrieve the correct row from your database, inflate a view if necessary, and return the populated view. If this procedure is relatively fast you may stick with a low sidebuffer such as 2 or 3, because a user won’t be able to scroll faster than it takes to load views into viewflow. Does that make sense?

    If you rather like to use the ViewPager instead, you might want to have a look at https://github.com/JakeWharton/Android-ViewPagerIndicator
    This library is derived from work done in android-viewflow to enable indicators for ViewPager. Perhaps android-viewflow will support that as well in the future.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload

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.