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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:06:46+00:00 2026-05-31T13:06:46+00:00

I am unable to figure out how to set text dynamically of an EditText.

  • 0

I am unable to figure out how to set text dynamically of an EditText. A fellow user at stackoverflow suggested me to use onTextChanged() but I don’t how that either.So I read on it for an hour and when tried to implement it,Errors Errors Errors!
So,I am asking this question again.

I have two EditTexts et1 and et2. Both are of type NumberDecimal.et2 is unfocusable and unclickable.The user can only input value in et1.What I want is that as soon as user enters a number in et1,that number should pe displayed in et2.So,if the user has to enter 10,he will first enter 1 and that 1 should also be displayed in et2.Now to complete the number,he will enter 0 and then the number 10 should be displayed in et2.So,et2 should be updated character by character depending upon the entry made in et1.

This is how I read from et1 :

et1=(EditText) findViewById(R.id.et1);
et2=(EditText) findViewById(R.id.et2);
String read=et1.getText().toString();
if(read.length()!=0)
{
float a=Float.parseFloat(read);
}

Now if I use setText() on et2,that wont be dynamic and furthermore I will have to make use of an button to show the text in et2 and it will show whole String which was entered in et1 until the button was clicked.

Using Listener on et1 is an good idea but I don’t know its implementation with onTextChanged since I am a newbie.

Please help.

Thanking you in anticipation.

  • 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-31T13:06:47+00:00Added an answer on May 31, 2026 at 1:06 pm

    Use the below code

    final TextView et2 = new TextView(this);
            TextView et1 = new TextView(this){
                @Override
                protected void onTextChanged(CharSequence text, int start,
                        int before, int after) {
                    // TODO Auto-generated method stub
                    super.onTextChanged(text, start, before, after);
                    et2.setText(this.getText());
                }
            };
    

    now add these et1,et2 to any layout.

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

Sidebar

Related Questions

Hey i am unable to figure out why this xml is not being generated
I am sure I am making some crazy mistake but unable to figure it
This seems like it should be really simple, but I'm unable to figure this
I'm unable to figure out how to capture a screenshot when a test fails
I'm getting index out of bounds exception and unable to figure out the reason,
I'm unable to figure out how to do the following... I'm pretty sure it's
I am just getting into XNA programming and have been unable to figure out
I've got a work around for this issue, but I'm trying to figure out
I have been unable to figure out this problem - it just doesn't make
I’m learning Cocoa programming, and I’m unable to figure out how to archive and

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.