Sabtu, 19 Februari 2011

InputFilter

InputFilters can be attached to Editables to constrain the changes that can be made to them.

ex.
        EditText edit = (EditText)findViewById(R.id.edit);
InputFilter[] FilterArray = new InputFilter[2];
FilterArray[0] = new InputFilter.LengthFilter(4); //Limit length of the text
FilterArray[1] = new InputFilter.AllCaps(); //capitalize all the lower case letters
edit.setFilters(FilterArray);


0 komentar:

Posting Komentar

Copyright © 2012 Codding News All Right Reserved