AutoCompleteTextView Control for Android Development

Source: Internet
Author: User

AutoCompleteTextView Control for Android Development

AutoCompleteTextView is an editable text that automatically displays and selects a string that matches the user's input string and its position.

Several methods are introduced: <喎?http: kf ware vc " target="_blank" class="keylink"> VcD4KPHA + signature + CjxwPtfUtq/samples/Signature + signature + ss7K/c6q19a3 + signature + 77f09DGpcXkz + signature + uMPM4cq + signature + v/Signature + PGJyPgo8L3A + signature + TWFpbkFjdGl2aXR5LmphdmE8YnI + cda-vcd4kpha + PHByZSBjbGFzcz0 = "brush: java; "> public class MainActivity extends Activity {AutoCompleteTextView autoCompleteTextView; String [] str = {" peach "," Pear "," Banana "," honeydew "," orange ", "tangerine"}; @ Overridepublic void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); autoCompleteTextView = (AutoCompleteTextView) findViewById (R. id. myview); ArrayAdapter ArrayAdapter = new ArrayAdapter (MainActivity. this, android. r. layout. simple_dropdown_item_1line, str); // match autoCompleteTextView after 3 characters in length. setThreshold (3); // The prompt message autoCompleteTextView. setCompletionHint ("select one"); // background autoCompleteTextView. setDropDownBackgroundResource (R. drawable. blue); // autoCompleteTextView. setDropDownBackgroundDrawable (d) autoCompleteTextView. setAdapter (arrayAdapter );}}



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.