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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:14:52+00:00 2026-05-28T01:14:52+00:00

what I am trying to do is: having multiple images in the screens, which

  • 0

what I am trying to do is:

  • having multiple images in the screens, which will be acting as buttons.
  • when a finger touch the screen and hover any image (any button), the image will be changed to another one(It will look like a hover button).
  • when he hover another one, the same will happen and the previous one will return to its state.

I tried to track that using OnTouchListener and didn’t work. Then, I read about Motionevent and I think it might help but I didn’t know for sure if it will.

Any one can answer or suggest a way to do this?

——————————————————

UPDATE

I tried this, but it seems not working. This is for img1 The same code will be for img2:

    img1.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            while(true){
            if(event.getAction()== MotionEvent.ACTION_OUTSIDE)
                img1.setImageResource(R.drawable.img); //default image
            else
                img1.setImageResource(R.drawable.img_pressed);

            }
        }
    });
  • 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-28T01:14:53+00:00Added an answer on May 28, 2026 at 1:14 am

    To those who might be interested:

    I couldn’t find a solution to my problem under my target devices’ level (API level 4). So, I gave up !

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

Sidebar

Related Questions

Here is a simplified version of what I'm trying to do: Without having multiple
I'm trying the MVVM Light Toolkit. Though I still think having multiple ViewModels for
I've been having trouble trying to get PIL to nicely downsample images. The goal,
i was trying to insert a string into database having multiple value using componentsSeparatedByString:@,.
I am trying to create a concatenation of multiple images into one, but have
Hi I am trying to create an layered image effect but I am having
I`m having trouble trying to optimize this query with OVER (PARTITION BY ...) because
Im having difficulty trying to design a database structure for the following scenario: My
I'm having problems trying to adjust the width of a column of a datagrid.
I am having trouble trying to get iterators for inner sub-containers. Basically imagine 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.