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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:59:17+00:00 2026-06-07T06:59:17+00:00

I have got an EditText in my Android app where you can type in

  • 0

I have got an EditText in my Android app where you can type in some text. What I want to do is change every single character to another one (some kind of enciphering). Therefore I first have to read every single character.

How can I do that?

UPDATE:
The text in the edit text is to be encoded on a button click.

  • 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-07T06:59:19+00:00Added an answer on June 7, 2026 at 6:59 am

    You can use InputFilter.

    As you go on typing below snippet will replace each character by $.

    Following Snippet will help you.

    InputFilter filter = new InputFilter() {
    
        @Override
        public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
            for (int i = start; i < end; i++) {
                return "$";
             }
            return null;
        }
    };
    
    EditText editText = (EditText) findViewById(R.id.rg);
    editText.setFilters(new InputFilter[] {filter});
    

    Below is my working snippet

    package org.vipul;
    
    import android.app.Activity;
    import android.os.Bundle;
    import android.text.InputFilter;
    import android.text.Spanned;
    import android.widget.EditText;
    
    public class AbcActivity extends Activity {
        EditText editText;
    
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            editText = (EditText) findViewById(R.id.rg);
    
            InputFilter filter = new InputFilter() {
    
                @Override
                public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
                     for (int i = start; i < end; i++) {
                        return "$";
                     }
    
                    return null;
                }
            };
    
    
            editText.setFilters(new InputFilter[] {
                filter
            });
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a text field, and then I type some text onto it.
I have got an edit text where I want that when someone insert her
I have a number of EditText fields on an Android app and I've used
What I want I have an EditText, where the user can enter a value,
I've got a part in my app where the user can view some notes
Have got an NSString *str = @12345.6789 and want to find out if there
I have got a suggestion to restrict an Android application to be installed a
have got a problem with do this kind of code , can't figure how
I am working on an app in which I have some edit texts and
I have got different issue in android application. I have taken 3 EditTexts 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.