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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:49:58+00:00 2026-05-23T18:49:58+00:00

I need a little help.I’m using a ViewFlipper to change views in TabActivity but

  • 0

I need a little help.I’m using a ViewFlipper to change views in TabActivity but not really sure how to do it.Here is my code :

MainActivity.class

public class Collections extends Activity implements OnClickListener {

    ViewFlipper vFlip;
    Button genre, recommended, soon;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.collections_layout);

        vFlip = (ViewFlipper) findViewById(R.id.tags_flipper);

        genre = (Button) findViewById(R.id.genre_btn);
        genre.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    vFlip.getCurrentView();
                }

            });
        recommended = (Button) findViewById(R.id.recom_btn);
        recommended.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    vFlip.getCurrentView();
                }

            });
        soon = (Button) findViewById(R.id.soon_btn);
        soon.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    vFlip.getCurrentView();
                }

            });
    }
}

I have three different xml, which I want to load with clicking the buttons.Here is the collection_layout.xml

Collection_layout.xml

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

            <LinearLayout
            android:id="@+id/actionbar"
            android:layout_width="fill_parent"
            android:layout_height="65px"
            android:background="@drawable/pink_bar"
            android:tileMode="repeat"
            android:orientation="vertical">

                <ImageView 
                    android:src="@drawable/stampii_logo"
                    android:id="@+id/stampii_logo_img"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:paddingTop="20px"/>

            </LinearLayout>

                <LinearLayout
                android:id="@+id/first_container"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">



                    <LinearLayout 
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:weightSum="1"
                    android:background="#d229ce">


                    <Button
                        android:id="@+id/genre_btn"
                        android:text="By Genre"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textSize="10dp" />

                    <Button
                        android:id="@+id/recom_btn"
                        android:text="Recommended"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textSize="10dp" />

                    <Button
                        android:id="@+id/soon_btn"
                        android:text="Expect Soon!"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textSize="10dp" />

                    </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:id="@+id/flip"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="#FFFFFF" >

                <ViewFlipper 
                    android:id="@+id/tags_flipper"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" >

                    <include android:id="@+id/genre" layout="@layout/by_genre" />
                    <include android:id="@+id/recom" layout="@layout/recommended" />
                    <include android:id="@+id/soon" layout="@layout/expect_soon" />
                </ViewFlipper>


        </LinearLayout>


</LinearLayout>

So how can i do that?Thanks a lot!

  • 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-23T18:49:59+00:00Added an answer on May 23, 2026 at 6:49 pm

    Use ViewFlipper.setDisplayedChild

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

Sidebar

Related Questions

I need some help with overlaying views using the prism framework.Its a little more
I need a little help here. This code correctly displays every format I enter--except
I need a little help here: I get a file from an HTML upload
hy, i need a little help here: i use SWFupload to upload images! in
I need a little help converting some VB.NET code to C#. I have tried
Hey, need a little help here. I have two models: class User < ActiveRecord::Base
I'm so close on this one, but I need a little help. I have
Need a little help with what I'm sure is fairly easy jquery I have
Need a little help here. I'm new to Coldfusion and I use CF6. I
I need a little help with (probably) something really simple. I want to use

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.