IT. Expert System.

Android Reference

DigitsKeyListener


android.text.method

Class DigitsKeyListener

  • All Implemented Interfaces:
    InputFilter, KeyListener


    public class DigitsKeyListener
    extends NumberKeyListener
    For digits-only text entry

    As for all implementations of KeyListener, this class is only concerned with hardware keyboards. Software input methods have no obligation to trigger the methods in this class.
    • Constructor Detail

      • DigitsKeyListener

        public DigitsKeyListener()
        Allocates a DigitsKeyListener that accepts the digits 0 through 9.
      • DigitsKeyListener

        public DigitsKeyListener(boolean sign,
                         boolean decimal)
        Allocates a DigitsKeyListener that accepts the digits 0 through 9, plus the minus sign (only at the beginning) and/or decimal point (only one per field) if specified.
    • Method Detail

      • getInstance

        public static DigitsKeyListener getInstance()
        Returns a DigitsKeyListener that accepts the digits 0 through 9.
      • getInstance

        public static DigitsKeyListener getInstance(boolean sign,
                                    boolean decimal)
        Returns a DigitsKeyListener that accepts the digits 0 through 9, plus the minus sign (only at the beginning) and/or decimal point (only one per field) if specified.
      • getInstance

        public static DigitsKeyListener getInstance(String accepted)
        Returns a DigitsKeyListener that accepts only the characters that appear in the specified String. Note that not all characters may be available on every keyboard.
      • getInputType

        public int getInputType()
        Description copied from interface: KeyListener
        Return the type of text that this key listener is manipulating, as per InputType. This is used to determine the mode of the soft keyboard that is shown for the editor.

        If you return InputType.TYPE_NULL then no soft keyboard will provided. In other words, you must be providing your own key pad for on-screen input and the key listener will be used to handle input from a hard keyboard.

        If you return any other value, a soft input method will be created when the user puts focus in the editor, which will provide a keypad and also consume hard key events. This means that the key listener will generally not be used, instead the soft input method will take care of managing key input as per the content type returned here.

      • filter

        public CharSequence filter(CharSequence source,
                          int start,
                          int end,
                          Spanned dest,
                          int dstart,
                          int dend)
        Description copied from interface: InputFilter
        This method is called when the buffer is going to replace the range dstart … dend of dest with the new text from the range start … end of source. Return the CharSequence that you would like to have placed there instead, including an empty string if appropriate, or null to accept the original replacement. Be careful to not to reject 0-length replacements, as this is what happens when you delete text. Also beware that you should not attempt to make any changes to dest from this method; you may only examine it for context. Note: If source is an instance of Spanned or Spannable, the span objects in the source should be copied into the filtered result (i.e. the non-null return value). TextUtils.copySpansFrom(android.text.Spanned, int, int, java.lang.Class, android.text.Spannable, int) can be used for convenience.
        Specified by:
        filter in interface InputFilter
        Overrides:
        filter in class NumberKeyListener


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1195 / . Delta: 0.03227 с