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

  • Home
  • SEARCH
  • 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 6989603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:14:01+00:00 2026-05-27T19:14:01+00:00

I Have eight View flipper which have 4 Question and 4 Answers . Which

  • 0

I Have eight View flipper which have 4 Question and 4 Answers. Which is display those Question and Answers, whenever that particular viewflipper is clicked. My problem is, When first time any viewflipper is clicked, at that time nothing to do, and after on viewflipper is clicked the next clicked viewflipper value want to check which is same(equal) or not.(If Question is 5+3 then answers should be 8).

Condition:

  1. if I am first time Q is clicked then next time another viewflipper which have Q is clicked nothing check operation is necessary and nothing hide .

  2. if I am first time Q is clicked then next time A is clicked retrive value from textview of Q and check is it right or not, if it
    is right hide both Q and A.

  3. if I am first time A is clicked then next timeQ is clicked retrive value from textview of A and check is it right or not, if it
    is right hide both Q and A.

  4. if I am first time A is clicked then next time another viewflipper which haveA is clicked nothing check operation is necessary nothing hide.

  5. if I am first time Q is clicked then next time same viewflipper which have Q is clicked nothing check operation is necessary nothing hide.

  6. if I am first time A is clicked then next time same viewflipper which have A is clicked nothing check operation is necessary nothing hide.

So, How to check Current clickable ViewFlipper and Previous clicked ViewFlipper. I did not get any idea how to check the problem.

Look at this, I think, my problem is more clear.

enter image description here

Edited: Dec 16

@Override
public void onClick(View v) {

    switch (v.getId()) {
    case R.id.vf1:
        try {
            if (click) {
                Message msg = new Message();
                msg.what = 1;
                delayHandler.sendMessageDelayed(msg, DELAYTIME);

                vFilpper1.showNext();


        } catch (Exception e) {
            e.printStackTrace();
        }
        counter++;
        break;
    case R.id.vf2:
        try {
            Message msg = new Message();
            msg.what = 2;
            delayHandler.sendMessageDelayed(msg, DELAYTIME);
            Log.d("viewfilpper", "VFlipper 2");

            vFilpper2.showNext();


        } catch (Exception e) {
            e.printStackTrace();
        }
        break;
    case R.id.vf3:
        try {
            Message msg = new Message();
            msg.what = 3;
            delayHandler.sendMessageDelayed(msg, DELAYTIME);
            Log.d("viewfilpper", "VFlipper 3");
            vFilpper3.showNext();


        } catch (Exception e) {
            e.printStackTrace();
        }
        break;

    case R.id.vf4:
        try {
            Message msg = new Message();
            msg.what = 4;
            delayHandler.sendMessageDelayed(msg, DELAYTIME);
            Log.d("viewfilpper", "VFlipper 4");
            vFilpper4.showNext();

        } catch (Exception e) {
            e.printStackTrace();
        }
        break;
    case R.id.vf5:
        try {
            Message msg = new Message();
            msg.what = 5;
            delayHandler.sendMessageDelayed(msg, DELAYTIME);
            Log.d("viewfilpper", "VFlipper 5");
            vFilpper5.showNext();

        } catch (Exception e) {
            e.printStackTrace();
        }
        break;
    case R.id.vf7:
        try {
            Message msg = new Message();
            msg.what = 7;
            delayHandler.sendMessageDelayed(msg, DELAYTIME);
            Log.d("viewfilpper", "VFlipper 7");
            vFilpper7.showNext();


        } catch (Exception e) {
            e.printStackTrace();
        }
        break;
    case R.id.vf8:
        try {
            Message msg = new Message();
            msg.what = 8;
            delayHandler.sendMessageDelayed(msg, DELAYTIME);
            Log.d("viewfilpper", "VFlipper 8");
            vFilpper8.showNext();


        } catch (Exception e) {
            e.printStackTrace();
        }
        break;
  • 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-27T19:14:02+00:00Added an answer on May 27, 2026 at 7:14 pm

    The problem is that your code is missing the state of the PREVIOUS selected ViewFlipper. I can only provide partial code as i don’t know the rest of your code.

    in the class which has your code snippet on here, the “public void onClick(View v) {” method, you want to have something like this:

    public class Puzzle extends Activity{ //or whatever your class is called
    
        private int previousFlipperID = -1; //this stores the previous state of the flipper that was selected
    
        @Override
        public void onClick(View v) {
            //.... your code, but modified
                // changes
            if(previousFlipperID == -1){
                //this is the VERY FIRST CLICK, using -1 to denotate that nothing was previously selected
                previousFlipperID = v.getId();
                return;  
            }
                // end changes
    
            switch (v.getId()) {
            case R.id.vf1:
            try {
                if (click) {
    
                // changes
                    switch(previousFlipperID){
                    case 0: 
                        //do your logic here that you stated. note that at this point in the code
                        // you are at the point where your PREVIOUS flipper was the first flipper
                        // and your CURRENT flipper is also the first one, since v.getId() is R.id.vf1
                        break;
                    case 1:  //some logic, but the CURRENT flipper is the first flipper, while PREVIOUS flipper was the second flipper
                        ...
                    case 7: //the previous flipper selected was the last flipper
                        break;
                    }
                // end changes
    
                    Message msg = new Message();
                    msg.what = 1;
                    delayHandler.sendMessageDelayed(msg, DELAYTIME);
    
                    vFilpper1.showNext();
    
            } catch (Exception e) {
                e.printStackTrace();
            }
            counter++;
            break;
    
            // changes
            previousFliperID = v.getId(); //update the previous flipper
            // end changes
    
        }
    }
    

    in my code, look for “//changes” especially. you’ll see that i used an integer to store the previous flipper. and then the way i check if it’s the FIRST time, is to check if the previous flipper was -1 or not. then at the end, make sure you set the current flipper id as the previous flipper id to update the “previous” flipper id for the next time.

    also, note that i had a nested switch statement in there, because you need a bunch of extra checks to do your logic for what happens, depending on what the current and previous flippers are.

    the answer is to the best of my abilities on information i’ve been told (and also to the best of my understanding), so i hope this helps.

    P.S. i feel guilty say this, but if my answer was correct, please please please check my answer, because i actually need some bounty points to ask bounty questions but i don’t think i have enough points. thanks! and happy holidays

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

Sidebar

Related Questions

I have a data set that is around 700 rows with eight columns of
I am working on an iphone app. I have eight tables in a view
I have an intermittent problem with some code that writes to a Windows Event
I have a table that has columns YEAR and MONTH, which are varchars, which
I have inherited a stored procedure which performs joins across eight tables, some of
i am developing an application which have eight advertisement boxes, the advertisement data with
I am interested in one topic, suppose that we have eight file, each containing
I have a string which follows literally : lt;img src=quot;http://www.news.gov.tt/thumbnail.php?file=Hon__Jerry_Narace_Minister__Of_Health_599152837.jpgamp;size=summary_mediumquot;gt;lt;pgt;Fifty-eight people have been tested
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Primary key attractiveness I have a boss(and also users) that wants primary key 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.