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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:49:34+00:00 2026-05-28T19:49:34+00:00

I have a viewflipper and two buttons next and previous outside the viewflipper. I

  • 0

I have a viewflipper and two buttons “next” and “previous” outside the viewflipper. I want viewflipper to show next background on clicking “next” and previous background on clicking “previous”. How can I do that?

  • 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-28T19:49:35+00:00Added an answer on May 28, 2026 at 7:49 pm

    There are two techniques to achieve your requirements.

    1. Use showPrevious and showNext methods of ViewFlipper class. One thing you have to know about these methods is by calling any method continuously, it will start displaying it’s children in ascending order for showNext and descending order for showPrevious.

    Example : View flipper has 4 children say 0, 1, 2, 3. Initially it will display first item i.e., child 0. Now if you called showNext 6 times continuously, it starts displaying 1, 2, 3, 0, 1, 2. So finally it will display child 2. Same procedure in descending order for shoePrevious also.

    2. Use setDisplayedChild method to display a particular child included in the ViewFlipper.

    Example: The view flipper may as below in XML layout file

    <ViewFlipper android:id="@+id/flipper"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >
        <include android:id="@+id/first"  layout="@layout/first_view" />
        <include android:id="@+id/second"  layout="@layout/second_view" />
    </ViewFlipper>
    

    To display first child you can use setDisplayedChild in two ways.

    call setDisplayedChild(R.id.first); or setDisplayedChild(0); means you can use Id of child in ViewFlipper or position of child in ViewFlipper.

    So depending on actual requirements, decide which method is appropriate.

    I hope you understand this.

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

Sidebar

Related Questions

I have a TabHost that has two ViewFlippers, and inside each ViewFlipper are three
I have a ViewFlipper that is transitioned between each view, I want to draw
I have a ScrolLView that wraps a ViewFlipper. The content in the ViewFlipper is
I have a ViewFlipper in my Activity that is used as a footer view
I have a ViewFlipper implementation that needs to be improved. This ViewFlipper has three
I need some help. In my android app I have a ViewFlipper that contains
What I have is two buttons at the top (equally filling 50% of the
I have a ViewFlipper which holds a single ImageView. i want to be able
Basically, I have a ViewFlipper that flips when I swipe my finger on it.
I have got a ViewFlipper that gets populated with multiple views, that are actually

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.