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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:39:21+00:00 2026-06-08T09:39:21+00:00

this application requires: first click will change image1 to image2 second click will change

  • 0

this application requires:
first click will change image1 to image2
second click will change back to old image (image2 to image1)

image1  = (ImageView)findViewById(R.id.imageView1);
        image1.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                image1.setImageResource(R.drawable.a3_01);
                image1.setTag(70);              
            }
        });

this image will set a new tag for the server knows that the picture have been change.

*the code i used is only for the first click and it works. ive just have no idea to make a second click event. can anyone gives me idea of it? much appreciate. thanks.

  • 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-08T09:39:22+00:00Added an answer on June 8, 2026 at 9:39 am

    You could use a boolean to act as a switch for you to flop back and forth with an if statement.

    boolean showingFirst = true;
    image1  = (ImageView)findViewById(R.id.imageView1);
    image1.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            if(showingFirst == true){
                image1.setImageResource(R.drawable.a3_02);
                showingFirst = false;
            }else{
                image1.setImageResource(R.drawable.a3_01);
                image1.setTag(70);
                showingFirst = true;
            }
    
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application requires a re-start at midnight time daily. For this job, according to
Please note this application will never be running on a server system. I am
I'm building my first application that requires a calendar. I have it working great
My application requires 2 screens and for this I have created two different XML
This is my first web application with WCF. So please guide me as a
This is my first post and will appreciate if I can get the solution
i have used impersonation in this application. whenever this error occurs i required to
My application.js file looks like this: //= require jquery //= require jquery_ujs //= require
I have a problem, my rake file looks like this: require File.expand_path('../config/application', __FILE__) require
This application is using windows integrated authentication in IIS. No anonymous login. It's also

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.