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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:16:01+00:00 2026-06-12T06:16:01+00:00

What I had to do was to implement a text input able to color

  • 0

What I had to do was to implement a text input able to color letters green or red. My piece of code can do this but there is a problem. I can’t write an national letter because the popup does not appear.


edit_text.addTextChangedListener(new TextWatcher() {
    boolean input_changed = false;        

    private boolean isInputBlocked()
    {
        this.input_changed = !this.input_changed;                
        return !this.input_changed;                
    }

    @Override
    public void afterTextChanged(Editable s) 
    {
        // Prevent recursive 
        if (isInputBlocked()) return;                                

        // Some staff                                                

        Outer.this.edit_text.setText(Html.fromHtml(html_input.toString()));
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count,
            int after) {}

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

When I commented Outer.this.edit_text.setText(Html.fromHtml(html_input.toString()));, the popup appears.

  • 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-12T06:16:02+00:00Added an answer on June 12, 2026 at 6:16 am

    The InputFilter helped me resolve the problem:

    InputFilter filter = new InputFilter() {
            final String good_letter = "<font color='#2FEE0D'>$</font>";
            final String bad_letter = "<font color='#FF0000'>$</font>";
    
            public CharSequence filter(CharSequence source, int start, int end, 
                    Spanned dest, int dstart, int dend) 
            {
                String input = dest.toString().substring(0, dstart) + source.
                        subSequence(start, end) + dest.toString().substring(dend);
                StringBuffer output = new StringBuffer();
                List<Entry<Character, Boolean>> correction = Learn.this.
                    learn_manager.getLetters(input);
    
                Log.d(TAG, "afterTextChanged: input size (" + input.length() + 
                        ")");
    
                System.out.println(input);
    
                for (int i = dstart; i < dstart + end; i++)
                {                    
                    if (correction.get(i).getValue())
                    {
                        output.append(this.good_letter.replace('$', correction.
                                get(i).getKey()));
                    } else {
    
                        output.append(this.bad_letter.replace('$', correction.
                                get(i).getKey()));
                    }
                }
    
                return Html.fromHtml(output.toString());
            } 
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had implement this push notification . I tried with push first message, it
I had try to implement the send me log feature into my apps but
I'm trying to implement this algorithm description from a previous question I had here
I am trying to implement a feature. But I've never had anything to do
In my rails3 project, I had to implement a simple text field, a div
How can I implement the below code (ActionScript) in Python? var bytes:ByteArray = new
I'm new to the wold of javascript/jquery, but had this fantastic idea for an
As a hobby project, I had like to implement a Morse code encoder and
I was hoping to implement an easy, but effective text search for App Engine
I have a form with 3 text fields and 3 checkboxes. I had implemented

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.