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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:24:20+00:00 2026-06-04T12:24:20+00:00

Is this even possible? I created this view flipper and I am calling the

  • 0

Is this even possible? I created this view flipper and I am calling the view flipper from the onClick inside of the xml layout. I have created a view flipper before but for some reason it’s not working.

<?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:cacheColorHint="@android:color/transparent"
    android:orientation="vertical" >

    <ViewFlipper
        android:id="@+id/viewFlipper1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@null"
        android:cacheColorHint="@android:color/transparent" >

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/vf_sample1_main"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:cacheColorHint="@android:color/transparent"
            android:orientation="vertical" >

            <include layout="@layout/headers_main" />

            <include layout="@layout/searchbar" />

            <TextView
                android:id="@+id/sdfsd"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:gravity="center_horizontal"
                android:maxHeight="85dp"
                android:paddingBottom="10dp"
                android:paddingTop="10dp"
                onClick="gotoSomething"
                android:singleLine="false" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@color/aquablue"
                android:textSize="15dp"
                android:textStyle="bold" />

            <include layout="@layout/listview_item_row_now_playing_info" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@color/aquablue"
                android:textSize="15dp"
                android:textStyle="bold" />

            <include layout="@layout/container_listview" />
        </LinearLayout>

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/vf_sdfsdfadf"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@null"
            android:cacheColorHint="@android:color/transparent"
            android:orientation="vertical" >

            <include layout="@layout/header_vf_asdfasdfadadafsd" />
        </LinearLayout>

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/vf_adsfasdfadsfasd"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@null"
            android:cacheColorHint="@android:color/transparent"
            android:orientation="vertical" >
        </LinearLayout>

    </ViewFlipper>

</LinearLayout>

code:

 public class BeatSpotPrototypeActivity extends BaseListActivity {
        private final String TAG = BeatSpotPrototypeActivity.class.getSimpleName();
        private ApplicationStateManager mAppStateMananger = ApplicationStateManager.GetInstance();
        private Context mCtx = null;
        private boolean mIsInitalized = false;
        private boolean mDataChanded= false;
        private ViewFlipper mViewFlipper= null;
        private DrawableManager mDrawManager = new DrawableManager();
        private enum ViewFlipperModes {
            MAIN (0),
            NOW_PLAYING (1),
            SONG_INFORMATION (2);

            private final int index;   

            ViewFlipperModes(int index) {
                this.index = index;
            }

            public int index() { 
                return index; 
            }
        }
        </code>
    <code>
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main_beatspot_activity);

            if (!mIsInitalized)
                init();
            else
                mDataChanded = true;
            showLoading(false);

        }

        private void init() {
            mCtx                                            = this;
            mIsInitalized                                   = true;
            mViewFlipper                                    = (ViewFlipper)findViewById(R.id.viewFlipper);
            fadeDrawables();
        }


        public void gotoBeatspotMain(View v) {
            mViewFlipper.setDisplayedChild(ViewFlipperModes.MAIN.index());
        }

        public void gotoNowPlaying(View v) {
            Log.d(TAG, mViewFlipper.getCurrentView().toString());
            mViewFlipper.setDisplayedChild(ViewFlipperModes.NOW_PLAYING.index());
        }

        public void gotoSongDetails(View v) {
            mViewFlipper.setDisplayedChild(ViewFlipperModes.SONG_INFORMATION.index());
            Log.d(TAG, String.valueOf(ViewFlipperModes.SONG_INFORMATION.index()));
        }

    }
  • 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-04T12:24:21+00:00Added an answer on June 4, 2026 at 12:24 pm

    before on create

    ViewFlipper mViewFlipper = (ViewFlipper)findViewbyId(location);
    

    on your onCreate() or onStart

    Ensure that whatever your layout on setcontentView(R.layout.something)
    does contain the view flipper

    Also try this for me. before this line mViewFlipper.setDisplayedChild(ViewFlipperModes.MAIN.index());
    Type in:

    int i = (ViewFlipperModes.MAIN.index()); place a debug point here
    mViewFlipper.setDisplayedChild(i);
    

    I also suggest using the debugger to try figure out if your flip views events are being called inside the debugger.

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/book_as_whole_Layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" 
        android:background="#FFFFFF">
    
        <ViewFlipper 
                android:layout_marginTop="20dip"
                android:layout_marginLeft="20dip"
                android:layout_marginRight="20dip"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/ViewFlipper">
            <LinearLayout 
                android:layout_width="match_parent"
                android:layout_height="match_parent">
    
            <TextView 
                android:id="@+id/page1"
                android:text="@string/loading_string"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:textColor="#000000"
                android:typeface="serif"/>  
    
            </LinearLayout>
    
            <LinearLayout 
                android:layout_width="match_parent"
                android:layout_height="match_parent">
            <TextView 
                android:id="@+id/page2"
                android:text="@string/loading_string"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:textColor="#000000"
                android:typeface="serif" />  
            </LinearLayout>
    
        </ViewFlipper>
    
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have no idea how this works or if it is even possible but
I don't even know if this is even possible, but I thought I'd ask.
I'm not sure if this is even possible, but is there a way to
Ok, not sure if this is even possible, but I want to change the
It probably isn't even possible to do this, but I will ask anyway. Is
so, just wondering if this is even possible i have been using the editor
From the tutorial I have created the layout: public static class LinedEditText extends EditText
Is this scenario even possible? class Base { int someBaseMemer; }; template<class T> class
I'm curious if this is even possible.
First of all I'm not sure this is even possible, however I need to

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.