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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:21:19+00:00 2026-05-27T01:21:19+00:00

In android app i m using two view flipper to flip the view. I

  • 0

In android app i m using two view flipper to flip the view. I want to provide the delay between flipping the view. I am invoking the on click handler on a view flipper. Here is my code.

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

            flipper = (ViewFlipper) findViewById(R.id.jetViewflipper);
            flippercow=(ViewFlipper) findViewById(R.id.cowViewflipper);

            flippercow.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
        Toast.makeText(getApplicationContext(), "on click method call",Toast.LENGTH_SHORT).show();              

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
                    flipper.setInAnimation(inFromLeftAnimation());
                    flipper.setOutAnimation(outToLeftAnimation());
                    flipper.showPrevious();

                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    /*Thread splashThread=new Thread()
                    {
                        public void run() {
                            try {
                                sleep(5000);
                            } catch (InterruptedException e) {
                                // TODO: handle exception
                            }
                            finally{
                                //splashThread.stop();
                            }

                        };
                    };
                    splashThread.start();*/

    Toast.makeText(getApplicationContext(), "delay ends",Toast.LENGTH_SHORT).show();                
                    //getcowFlipper();              
                    flippercow.setInAnimation(inFromBottomAnimation());
                    flippercow.setOutAnimation(outToTopAnimation());
                    flippercow.showNext();
                    //flipper.showPrevious();
    Toast.makeText(getApplicationContext(), "method ends",Toast.LENGTH_SHORT).show();               

                }
            });
     }

In the above code the delay is executed first and then view flips later.

  • 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-27T01:21:19+00:00Added an answer on May 27, 2026 at 1:21 am

    Your inFromLeftAnimation() + inFromRightAnimation() + outFromLeftAnimation() + outFromRightAnimation() methods contains part like this:

    inFromLeft.setDuration(400);
    

    Above part will give a 400ms delay.
    Ofcourse you also got the inFromRight, outFromLeft etc.

    Example:

        private Animation inFromLeftAnimation() 
        {
          Animation inFromLeft = new TranslateAnimation(
          Animation.RELATIVE_TO_PARENT,  -1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,
          Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f);
    
          inFromLeft.setDuration(400);
          inFromLeft.setInterpolator(new AccelerateInterpolator());
          return inFromLeft;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my app i am using the view flipper. One side of the flip
i want to pass data between two activities.In the first activity i m using
I have developed an app in android 4.0.3(Ice-cream Sandwich), i am using two activities
if yes, is there a tutorial available for creating an android app using the
I'm starting Android Market via my app to search for similar products using this
My android app has a two word app name, and the 2nd word doesn't
I'm building an Android app and I want to copy the text value of
We have an Android app and a Web Service. We want to download part
I have an Android app with a ListActivity in the main view. The list
I've got an Android app which has a periodic background Service. I want this

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.