Example usage for android.text InputFilter.LengthFilter InputFilter.LengthFilter

List of usage examples for android.text InputFilter.LengthFilter InputFilter.LengthFilter

Introduction

In this page you can find the example usage for android.text InputFilter.LengthFilter InputFilter.LengthFilter.

Prototype

public LengthFilter(int max) 

Source Link

Usage

From source file:Main.java

public static EditText applyMaxCharsFilter(EditText field, int length) {
    InputFilter[] FilterArray = new InputFilter[1];
    FilterArray[0] = new InputFilter.LengthFilter(length);
    field.setFilters(FilterArray);//w w w  .j a v  a  2 s.c  o  m
    return field;
}