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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:13:32+00:00 2026-06-09T02:13:32+00:00

I have an App with 10 Buttons. Everytime the User presses on one Button

  • 0

I have an App with 10 Buttons. Everytime the User presses on one Button A TextView should change. And if the User changes the focus and ,oves its finger to right, to the next button(without taking the finger off the screen) the seond button should be focused.

I tried it with setting an OnTouchListner to all buttons, but once the finger is moved the focus still stays on the first button:

btn1.setOnTouchListener(new View.OnTouchListener() {

            public boolean onTouch(View v, MotionEvent event) {
                // TODO Auto-generated method stub
                txt1.settext("1");
                return false;
            }
        });

I hope you understood what I mean and can help me with this.

Thanks

Edit:

I found an Application which does that, here is a Video, so you can visualise what I mean.
Notice how I move the mouse(the finger in this case) and the Boxes change its focus:

http://www.youtube.com/watch?v=MRVFpNrBmsA&feature=youtu.be

  • 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-09T02:13:35+00:00Added an answer on June 9, 2026 at 2:13 am

    To start in your onTouch() you should handle the events…

    Something like

            public boolean onTouch(View v, MotionEvent event) {
    
                if(event.getAction() == MotionEvent.ACTION_HOVER_ENTER) {
                   txt1.settext("1");
                } else if(event.getAction() == MotionEvent.ACTION_HOVER_EXIT){
                   txt1.settext("0");
                }
                return true;
            }
    

    Not sure if those are the proper actions to check against but it is just to give the idea.

    Also I believe you should return true otherwise it means that the event wasn’t processed and it gets stuck.

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

Sidebar

Related Questions

So, my app consists of a textview in one view controller. When the user
In my app I have a table view where the user presses an add
my app have action bar on top of windows. Where are some buttons. Buttons
I have a winforms app and the main (and only) form has several buttons.
In my WP 7.1 app I have a page with multiple buttons. I noticed
I have a WPF app that is using the MVVM pattern. Hooking up buttons
I have two buttons in my flex app next to each other, ButtonA and
I have several buttons on my app that are being created dynamically. They are
So I have these buttons in my app that I want to open .PDF
I have an view in my App which has a number of buttons based

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.