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

  • Home
  • SEARCH
  • 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 6876915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:32:14+00:00 2026-05-27T04:32:14+00:00

On my android app, first time when app runs, user must type a license.

  • 0

On my android app, first time when app runs, user must type a license. The license’s format is ###-XXX-###-### where # is a number, X is a character. I put the format as hint but it is not sufficient. How can I make like this and user does not enter -, it just appear after 3 characters ?

UPDATE :

That’s my code and it works :

licenseEditText.addTextChangedListener(new TextWatcher() {

            public void afterTextChanged(Editable s) {
                System.out.println("afterTextChanged");
                if (s.length() == 3) {
                    s.append("-");
                }
                if (s.length() == 7) {
                    s.append("-");
                }
                if (s.length() == 11) {
                    s.append("-");
                }
                if (s.length() == 15)
                    ok.performClick();
            }

            public void beforeTextChanged(CharSequence s, int start, int count,
                    int after) {
                System.out.println("beforeTextChanged");
            }

            public void onTextChanged(CharSequence s, int start, int before,
                    int count) {
                System.out.println("onTextChanges");

            }
        });
  • 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-27T04:32:15+00:00Added an answer on May 27, 2026 at 4:32 am

    set a TextWatcher , inside it compare intered text with a regularExpression . and put other code like after first 3 charachets append “-” to intered characterSet .

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

Sidebar

Related Questions

It is my first time building an android app. Was wondering firstly, if there
Here's my two scenarios. 1 - User opens app for the first time ever
A couple of firsts here - first Android app and first time using MonoDroid
I am first time developing an android app. Very new to this. I have
I'm writing my first android app (I'm a noob at android, but decent at
I've just started debugging my first three line long android app and I can't
I'm trying to build a simple Android app that increments a number displayed every
I'm building my first android app - something that will display my tweets in
I have an Android App with a number of activities. The wrong activity is
So here I have this first time app I'm working on. When I run

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.