Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

MultiTapKeyListener

public class MultiTapKeyListener
extends BaseKeyListener implements SpanWatcher

java.lang.Object
   ↳ android.text.method.MetaKeyKeyListener
     ↳ android.text.method.BaseKeyListener
       ↳ android.text.method.MultiTapKeyListener


This is the standard key listener for alphabetic input on 12-key keyboards. You should generally not need to instantiate this yourself; TextKeyListener will do it for you.

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.

Summary

Inherited constants

Public constructors

MultiTapKeyListener(TextKeyListener.Capitalize cap, boolean autotext)

Public methods

int getInputType()
static MultiTapKeyListener getInstance(boolean autotext, TextKeyListener.Capitalize cap)

Returns a new or existing instance with the specified capitalization and correction properties.

boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event)

Handles presses of the meta keys.

void onSpanAdded(Spannable s, Object what, int start, int end)

This method is called to notify you that the specified object has been attached to the specified range of the text.

void onSpanChanged(Spannable buf, Object what, int s, int e, int start, int stop)

This method is called to notify you that the specified object has been relocated from the range ostart…oend to the new range nstart…nend of the text.

void onSpanRemoved(Spannable s, Object what, int start, int end)

This method is called to notify you that the specified object has been detached from the specified range of the text.

Inherited methods

Public constructors

MultiTapKeyListener

added in API level 1
public MultiTapKeyListener (TextKeyListener.Capitalize cap, 
                boolean autotext)

Parameters
cap TextKeyListener.Capitalize

autotext boolean

Public methods

getInputType

added in API level 3
public int getInputType ()

Returns
int

getInstance

added in API level 1
public static MultiTapKeyListener getInstance (boolean autotext, 
                TextKeyListener.Capitalize cap)

Returns a new or existing instance with the specified capitalization and correction properties.

Parameters
autotext boolean

cap TextKeyListener.Capitalize

Returns
MultiTapKeyListener

onKeyDown

added in API level 1
public boolean onKeyDown (View view, 
                Editable content, 
                int keyCode, 
                KeyEvent event)

Handles presses of the meta keys.

Parameters
view View

content Editable

keyCode int

event KeyEvent

Returns
boolean

onSpanAdded

added in API level 1
public void onSpanAdded (Spannable s, 
                Object what, 
                int start, 
                int end)

This method is called to notify you that the specified object has been attached to the specified range of the text.

Parameters
s Spannable

what Object

start int

end int

onSpanChanged

added in API level 1
public void onSpanChanged (Spannable buf, 
                Object what, 
                int s, 
                int e, 
                int start, 
                int stop)

This method is called to notify you that the specified object has been relocated from the range ostart…oend to the new range nstart…nend of the text.

Parameters
buf Spannable

what Object

s int

e int

start int

stop int

onSpanRemoved

added in API level 1
public void onSpanRemoved (Spannable s, 
                Object what, 
                int start, 
                int end)

This method is called to notify you that the specified object has been detached from the specified range of the text.

Parameters
s Spannable

what Object

start int

end int