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);