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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:55:31+00:00 2026-06-06T12:55:31+00:00

I wrote a small test program for flipperview. I have 3 views. I call

  • 0

I wrote a small test program for flipperview. I have 3 views. I call startFlipping() to bring in the next view, so it goes from the first view, second, 3rd and back to the first

Is thee a way that instead of going to the next view, I could have flipper go directly to any of the 3 different views???

If not, is there a way to hide a vertical container? Maybe I could have 3 vertical containers, have 2 hidden and one shown?

code:

public class TestviewflipperActivity extends Activity implements
    OnClickListener{
    /** Called when the activity is first created. */
    ViewFlipper mFlipper;

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

        // add listeners
        View mButA = findViewById(R.id.flipbut);
        mButA.setOnClickListener(this);

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


        View mBut = findViewById(R.id.back_btna);
        mBut.setOnClickListener(this);


    }



    public void onClick(View v) {

mFlipper.startFlipping();   
    }
}

and the layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <Button android:text="Go Back" 
           android:id="@+id/flipbut"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" />


  <ViewFlipper android:id="@+id/flipper"
              android:layout_width="fill_parent" 
              android:layout_height="fill_parent">





   <LinearLayout android:layout_width="fill_parent"
             android:layout_height="fill_parent" 
             android:orientation="vertical"           
                android:id="@+id/screenA"
             >

   <TextView android:layout_width="wrap_content" 
             android:layout_height="wrap_content"
          android:text="TEST screen a" 
          android:layout_gravity="center" 
          android:padding="15dip"
          android:textSize="22dip" />


   <Button android:text="Go Back" 
           android:id="@+id/back_btna"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" />


  </LinearLayout>

    <LinearLayout android:layout_width="fill_parent"
                 android:layout_height="fill_parent" 
                 android:orientation="vertical"           
                    android:id="@+id/screenB"
                 >

       <TextView android:layout_width="wrap_content" 
                 android:layout_height="wrap_content"
              android:text="screenb" 
              android:layout_gravity="center" 
              android:padding="15dip"
              android:textSize="22dip" />


       <Button android:text="Go Back" 
               android:id="@+id/back_btnb"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" />

      </LinearLayout>

    <LinearLayout android:layout_width="fill_parent"
                 android:layout_height="fill_parent" 
                 android:orientation="vertical"           
                    android:id="@+id/screenC"
                 >

       <TextView android:layout_width="wrap_content" 
                 android:layout_height="wrap_content"
              android:text="screenC" 
              android:layout_gravity="center" 
              android:padding="15dip"
              android:textSize="22dip" />


       <Button android:text="Go Back" 
               android:id="@+id/back_btnc"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" />

      </LinearLayout>

     </ViewFlipper>

    </LinearLayout>
  • 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-06T12:55:33+00:00Added an answer on June 6, 2026 at 12:55 pm

    You should be able to use mFlipper.setDisplayedChild(int whichChild) to make it filp to the view you desire in your code. The method is defined in ViewFlipper‘s parent, ViewAnimator.

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

Sidebar

Related Questions

I wrote a small program to test accessing a widget parent's slot. Basically, it
Here's a small test program I wrote: #include <iostream> using namespace std; class A
I wrote a small program in VS2005 to test whether C++ global operator new
I have a small program wrote in Prolog. At the moment I can print
Have small web page at www.peterbio.com/mom/test.htm Someone wrote the code with mouse over and
I wrote a small test program with a sample class containing also self-defined constructor,
I wrote a small C++ program in VS2k8. When I launch it from windows
I wrote a small program to test out Textmate 2 (I'm fairly new to
I wrote a small program to test GCC's options. int main() { int a=0;
I imported LuaInterface into a console project, referenced it, and wrote a small test

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.