multiautocompletetextview


How to limit MultiAutoCompleteTextView items/inputs


I have MultiAutoCompleteTextView use for selecting multiple recipient in a messaging app but I just want to limit it only to two recipient or 3. User should not be able to add more recipient once the limit is reached. Any hints how to do that?
final MultiAutoCompleteTextView mtv = (MultiAutoCompleteTextView) this
.findViewById(R.id.to);
final MobilePhoneAdapter mpa = new MobilePhoneAdapter(this);
final SharedPreferences p = PreferenceManager
.getDefaultSharedPreferences(this);
MobilePhoneAdapter.setMobileNumbersOnly(p.getBoolean(
PreferencesActivity.PREFS_MOBILE_ONLY, false));
mtv.setThreshold(2);
mtv.setAdapter(mpa);
((MultiAutoCompleteTextView) mtv).setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
mtv.setText(to);

Related Links

How to limit MultiAutoCompleteTextView items/inputs

Categories

HOME
url-redirection
developer-tools
apache-flink
nvd3.js
requirements
grafana
nuget
rds
vxml
square
jetty
crystal-lang
extjs4.2
sendgrid-api-v3
dkim
reactive-programming
frequency-distribution
intershop
wolframalpha
mapstruct
solrcloud
replication
guzzle
spring-async
exit
interpreter
roundup
game-theory
tiki-wiki
fat
soot
realm-mobile-platform
google-cast
python-2.6
deltaspike
catch-unit-test
code-snippets
video-capture
imagenet
stringtokenizer
chronicle-map
apache-spark-dataset
servermanager
getchar
sonarlint-eclipse
yii2-api
geotiff
convex-optimization
trojan
modelsim
reshape
juice-ui
custom-lists
xcode-server
tinkerpop3
jodd
synonym
lean
jclouds
ikiwiki
grass
false-sharing
qbxml
piracy-prevention
mobiledoc-kit
linklabel
roadkill-wiki
forwarding
finalbuilder
vacuum
skspritenode
zend-currency
bcache
document-repository
variadic-templates
angular-gettext
boost-program-options
template-deduction
reflector
sbcl
high-resolution
node-blade
booksleeve
redis-py
veracity
database-create
usertype
gobject-introspection
saxparseexception
matlab-load
rmdir
globals
sifr
data-mapping
scrubyt

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App