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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:10:16+00:00 2026-06-03T16:10:16+00:00

I have 4 text boxes and when the user clicks a button i wish

  • 0

I have 4 text boxes and when the user clicks a button i wish to insert the relevant text and move on to the next text box and insert the next text in that box. i have got some distance my code so far is.

Time1Btn = (Button)findViewById(R.id.Time1Btn);
Time2Btn = (Button)findViewById(R.id.Time2Btn);
Time1HrEB = (EditText)findViewById(R.id.Time1HrEB);  // i would guess this would be replaced

Time1Btn.setOnClickListener(MyOnClickListener);
Time2Btn.setOnClickListener(MyOnClickListener);

private View.OnClickListener MyOnClickListener = new OnClickListener(){
    public void onClick(View v){
   Button b = (Button)v;
   EditText e = (EditText).getCurrentFocus(); // attemt of what to do

   String buttonText = b.getText().toString();
   e.setText(buttonText); // this is the line i wish to replace.
   int id = getCurrentFocus().getNextFocusRightId();

       findViewById(id).requestFocus();
      }
};   

my layout file is.

<EditText
            android:id="@+id/Time1HrEB"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:inputType="number"
            android:maxWidth="30dp"
            android:minWidth="30dp"
            android:nextFocusRight="@+id/Time2HrEB"
          >
</EditText>

<EditText
            android:id="@+id/Time2HrEB"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:inputType="number"
            android:minWidth="30dp"
             />
etc...

any ideas… i have tryed some things…

  • 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-03T16:10:19+00:00Added an answer on June 3, 2026 at 4:10 pm

    you are close

    View et = getCurrentFocus()
    EditText e = (EditText) et;
    e.setText(buttonText);
    

    give it a try and let me know.

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

Sidebar

Related Questions

I have 2 text boxes and a radio button. When the user clicks submit
I am creating a user control where in i have different HTML text boxes
I have a user control in my wp7 application which contains two text boxes
I have a bunch of input text boxes that have the attribute ORIGINAL set
I have to build a page which contains some text boxes and a grid
I have a web page that has a few text boxes, and a dual
I have a form that has 3 text boxes for 3 input values, along
I have a global variable called 'name', when a user clicks on a button
I have a set of html text boxes that take input and when the
I have a quotation form where the user fills out the boxes, clicks submit

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.