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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:46:06+00:00 2026-06-04T15:46:06+00:00

Hello I want to know how to highlight all Words that is inputted in

  • 0

Hello I want to know how to highlight all Words that is inputted in the EditText and will appear in the TextView this post is related to this one Highlight Textview Using EditText

  • 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-04T15:46:08+00:00Added an answer on June 4, 2026 at 3:46 pm

    Say et is your EditText and tv is TextView object. Use the following code:


    public class MotivationalQuotesActivity extends Activity {
        /** Called when the activity is first created. */
    
    Button next;
    EditText et; 
    TextView tv;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
       et = (EditText) findViewById(R.id.et);
       tv = (TextView) findViewById(R.id.tv);
       tv.setText("The name of our country is Bangladesh. Bangladesh is a land of rivers.");
    
       next = (Button) findViewById(R.id.button1);
        next.setOnClickListener(new OnClickListener() {
    
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    tv.setText("The name of our country is Bangladesh. Bangladesh is a land of rivers.");
                    String ett =et.getText().toString();
                    String tvt =tv.getText().toString();
    
                    int ofe = tvt.indexOf(ett,0);   
                    Spannable WordtoSpan = new SpannableString( tv.getText() );
    
            for(int ofs=0;ofs<tvt.length() && ofe!=-1;ofs=ofe+1)
            {       
    
    
                  ofe = tvt.indexOf(ett,ofs);   
                      if(ofe == -1)
                          break;
                      else
                          {                       
    
                          WordtoSpan.setSpan(new BackgroundColorSpan(0xFFFFFF00), ofe, ofe+ett.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                          tv.setText(WordtoSpan, TextView.BufferType.SPANNABLE);
                          }
    
    
            }  
    
    
                }
            });
    
        }
    
    }
    

    The result is:

    enter image description here

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

Sidebar

Related Questions

hello i am little new to all this but i want to know that:
I want to know, is this legal? function test() { alert (hello) $(#loading).show(); }
I was following this example: http://developer.android.com/resources/tutorials/views/hello-autocomplete.html And I want to know how I can
Hello I want to know what all I should take care about for memory
hello friends i just want to know that whether we can access or fetch
Possible Duplicate: iPhone development on Windows Hello friends, I Want To Know that Is
Hello i want to make a site that will have a registration page a
Hello want to know if i can get some help on this as i
Hello I want to click a button that will add a new button to
Hello I want to know if is possible to modify a cube dimension in

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.