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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:27:28+00:00 2026-06-14T15:27:28+00:00

I defined a EditText in XML with attribute android:inputType=numberSigned , so, when I try

  • 0

I defined a EditText in XML with attribute android:inputType=”numberSigned”, so, when I try to get it in Java Code like:

int type = mEditText.getInputType();
switch(type){
case InputType.TYPE_NUMBER_FLAG_SIGNED:
//do when I get EditText defined with 'numberSinged'
//do something
break;
}

But, It doesn’t work for me. So I try to check Android source code, TYPE_NUMBER_FLAG_SIGNED=4096. When I try to print println(mEditText.getInputType()),it turns to be 4098. And I can’t find any variable equals 4098.
Can anybody tell me the reason?

I’m not good at English, may you can understand me! Thanks!

  • 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-14T15:27:29+00:00Added an answer on June 14, 2026 at 3:27 pm

    there can be multiple flags assigned to inputType. To find out if a flag is set or not, use the bitwise AND (&) operator:

    int type = mEditText.getInputType();
    if((type & InputType.TYPE_NUMBER_FLAG_SIGNED) > 0)
    {
        // your stuff here
    }
    

    I guess, the usage of switch case is not possible here.

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

Sidebar

Related Questions

Ok I have my main.xml defined like: <LinearLayout android:id=@+id/linearLayout1 android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android> <EditText
I need to get the EditText that's defined in an xml layout which is
ANDROID I have a layout defined in xml and have a static textview, edittext
I have an Edit Text that is defined as follows. <EditText android:layout_width=fill_parent android:layout_height=wrap_content android:maxLines=1
I have this EditText definition: <EditText android:layout_height=wrap_content android:layout_width=fill_parent android:inputType=textEmailAddress android:id=@+id/EmailText/> Notice the EditText has
I have a collapsible menu item that is defined in XML like this: <item
My Android app's main activity looks like this: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/RelativeLayout1
I've got a View defined in an xml file. It contains two Edittext fields
This is the code I am using in android programming EditText pass1,pass2; Button register=(Button)
i'm new with Android and i'm writing a simple alarm clock application.when i type

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.