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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:58:14+00:00 2026-06-07T05:58:14+00:00

I have a number of EditText fields on an Android app and I’ve used

  • 0

I have a number of EditText fields on an Android app and I’ve used android:digits to stop invalid characters being input.

eg:
android:digits="@string/validchars"
(where “validchars” is a string resource of all the valid characters – eg A-Z, 0-9, and some punctuation )

The problem is, if the user hits the ENTER key on the soft keyboard it used to take them to the next field but since I added android:digits bit this has stopped working. I’ve tried adding \n to the validchars but this just allows Carriage Returns in the single line textboxes (!) so doesn’t help. I’ve tried fiddling with the imeOptions (adding actionNext etc) but this doesn’t seem to fix it either.
I’ve read about TextWatchers and InputFilters but both seem to be over-complicated for what I’m trying to do and the android:digits bit works fine in stopping the invalid characters.

Has anyone got any ideas?

I’m using Android SDK version 8 and targeting both 2.2 and 2.3.5 devices.

  • 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-07T05:58:15+00:00Added an answer on June 7, 2026 at 5:58 am

    After a bit of poking around with the attributes available for an EditText I found that when I add android:singleLine=”true” the ENTER key now moves the focus to the next field, even when a android:digits is restricting the characters entered. Problem solved! (for me, anyway!)

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

Sidebar

Related Questions

I am working on a android app and I have an EditText where user
I have an EditText widget in my Android application with inputtype=number . It does
I have a button and an edittext. The user enters a number and then
I have 3 edittexts with input type as number and 1 button that say
I have an EditText input that I would like to only allow numbers 1
I have number of line breaks in a string. But I only want it
I have a number input that should trigger jQuery on every change. To do
I have a number edittext . I want to limit the entry of the
In my xml i have an edittext element like this <EditText android:id=@+id/hrvalue android:layout_width=wrap_content android:layout_height=wrap_content
I am new to android. I have a loginActivity which validates a user number

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.