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

The Archive Base Latest Questions

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

I want to set the Edittext as like, whatever i write and enter in

  • 0

I want to set the Edittext as like, whatever i write and enter in to the EditText, it should be written in to the TextView at the same Moment.

I think it can be possible by adding any istener.
I am not able to implement it. So Please anyone help me in this . ?
thanks.

 includedText.addTextChangedListener(new TextWatcher() {

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {

                if(!(includedText.getText().toString().equals("")))
                {
                    double included = Double.parseDouble(includedText.getText().toString());
                    included = roundTwoDecimals(included);
        //          double amountValue = (excluded*15/100);

                    String amt = String.valueOf(roundTwoDecimals(included-(included/1.15)));
                    String excluded = String.valueOf(included/1.15);
                    System.out.println("The Amount is: "+amt);
                    amountText.setText(amt);
                    try{
                        excludedText.setText(excluded); //////// Error
                    }
                    catch(Exception e)
                    {
                        e.printStackTrace();
                    }
                }
                else
                {
                    amountText.setText("");
                    //excludedText.setText("");
                }

        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count,
                int after) {
            // TODO Auto-generated method stub

        }

        @Override
        public void afterTextChanged(Editable s) {
            // TODO Auto-generated method stub

        }
    });

    excludedText.addTextChangedListener(new TextWatcher() 
    {

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            if(!(excludedText.getText().toString().equals("")))
            {
                double excluded = Double.parseDouble(excludedText.getText().toString());
                excluded = roundTwoDecimals(excluded);
        //      double amountValue = (excluded*15/100);

                String amt = String.valueOf(roundTwoDecimals(excluded*0.15));
                String included = String.valueOf(roundTwoDecimals(excluded+(excluded*0.15)));
                System.out.println("The Amount is: "+amt);
                amountText.setText(amt);
                includedText.setText(included);
            }
            else
            {
                amountText.setText("");
                includedText.setText("");
            }

        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count,
                int after) {
            // TODO Auto-generated method stub

        }

        @Override
        public void afterTextChanged(Editable s) {
            // TODO Auto-generated method stub

        }
    });

Logcat:

    10-08 10:34:27.239: ERROR/AndroidRuntime(662): FATAL EXCEPTION: main
10-08 10:34:27.239: ERROR/AndroidRuntime(662): java.lang.StackOverflowError
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.text.DynamicLayout.reflow(DynamicLayout.java:261)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.text.DynamicLayout.<init>(DynamicLayout.java:150)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.makeNewLayout(TextView.java:4851)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.checkForRelayout(TextView.java:5348)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2688)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$1.onTextChanged(GSTActivity.java:66)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$2.onTextChanged(GSTActivity.java:110)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$1.onTextChanged(GSTActivity.java:66)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$2.onTextChanged(GSTActivity.java:110)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$1.onTextChanged(GSTActivity.java:66)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$2.onTextChanged(GSTActivity.java:110)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$1.onTextChanged(GSTActivity.java:66)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$2.onTextChanged(GSTActivity.java:110)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$1.onTextChanged(GSTActivity.java:66)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2556)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.EditText.setText(EditText.java:75)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2531)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at com.project.TaxCalculator.GSTActivity$2.onTextChanged(GSTActivity.java:110)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextView.setText(TextView.java:2691)
10-08 10:34:27.239: ERROR/AndroidRuntime(662):     at android.widget.TextVie
  • 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-26T01:17:52+00:00Added an answer on May 26, 2026 at 1:17 am

    Use the addTextChangedListener method on your EditText and make your class implement or define an inner class implementing the TextWatcher class:

    textMessage = (EditText)findViewById(R.id.textMessage);
        textMessage.addTextChangedListener(new TextWatcher(){
            public void afterTextChanged(Editable s) {
    
    }
            public void beforeTextChanged(CharSequence s, int start, int count, int after){}
            public void onTextChanged(CharSequence s, int start, int before, int count){}
        }); 
    

    For more :: Android: How can I get EditText change?

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

Sidebar

Related Questions

There are an EditText and a TextView in my Activity. I want to set
I set my tabWidget at the bottom. When i want to edit the edittext
I have an EditText that the user can write in, when the app starts
I have a question about EditText in Android. How can I set the hint
I want to simply set the height of an EditText component to be 50%
I want to set the hint in spinner. Like in edit text, I am
I have edittext where I want to enter percentage value i.e decimals value, So
I'd like to set focus to an EditText and automatically bring up the virtual
I want set interfaceOrientation in one UIView as LandscapeLeft and Portrait in other UIView.
i want set the visibility to itemized overlay in map view. if the zoom

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.