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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:45:46+00:00 2026-05-30T10:45:46+00:00

To prevent the infinite loop I did something as ugly as this… @Override protected

  • 0

To prevent the infinite loop I did something as ugly as this…

    @Override
protected void onTextChanged(CharSequence text, int start,
        int lengthBefore, int lengthAfter) {

    String t = text.toString();
    String tt = t.toUpperCase();

    if (!t.equals(tt)) {

        setText(tt);
    }

    super.onTextChanged(text, start, lengthBefore, lengthAfter);
}

Is there any other way to prevent the onTextChanged from being called when changing the text within onTextChanged?

  • 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-30T10:45:47+00:00Added an answer on May 30, 2026 at 10:45 am

    You could use flags that specify if the text has been changed once or not. If it has been changed once, then do not change again, else change it.

    int flag_text=0;
    protected void onTextChanged(CharSequence text, int start,
        int lengthBefore, int lengthAfter) {
    
        if (flag_text==0) {
            flag_text=1;
            setText(tt);
        }
        super.onTextChanged(text, start, lengthBefore, lengthAfter);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This causes an infinite recursive loop when setattr is called, when trying to set
How do I prevent Cyclone from converting the code? I mean, I want this
I have a little question ,I have a NSString object (\n 1 Infinite Loop,\n
protected void downloadFunction(string filename) { string filepath = @D:\XtraFiles\ + filename; string contentType =
I'm just trying to play music continuously in an infinite loop until a button
The error i am having here is a infinite or near infinite loop in
The Bootstrap carousel is a strange beast. I've tried tweaking $next to prevent infinite
To string on a collection can get into a infinite loop if somewhere in
To prevent SQL injection, is it necessary to use mysql_real_escape_string() , when magic_quotes_gpc is
I'm trying to prevent certain keys from being entered into an input box, but

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.