2 * Copyright (C) 2009 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.android.imftest.samples;
19 import android.app.Activity;
20 import android.os.Bundle;
21 import android.view.KeyEvent;
22 import android.view.View;
23 import android.view.ViewGroup;
24 import android.view.WindowManager;
25 import android.widget.LinearLayout;
26 import android.view.inputmethod.InputMethodManager;
27 import android.widget.EditText;
28 import android.widget.TextView;
29 import android.widget.AutoCompleteTextView;
30 import android.widget.ArrayAdapter;
32 import com.android.internal.R;
35 * Activity with AutoCompleteTextView (Candidate bar should not appear)
37 public class AutoCompleteTextViewActivityPortrait extends Activity
40 public void onCreate(Bundle savedInstanceState)
42 super.onCreate(savedInstanceState);
44 setContentView(R.layout.auto_complete_list);
46 ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
47 android.R.layout.simple_dropdown_item_1line, COUNTRIES);
48 AutoCompleteTextView textView = findViewById(R.id.edit);
49 textView.setAdapter(adapter);
52 static final String[] COUNTRIES = new String[] {
53 "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
54 "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
55 "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
56 "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
57 "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
58 "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
59 "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
60 "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
61 "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
62 "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
63 "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czechia",
64 "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
65 "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
66 "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
67 "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
68 "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
69 "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
70 "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
71 "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
72 "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
73 "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
74 "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
75 "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
76 "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
77 "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
78 "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
79 "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
80 "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
81 "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
82 "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
83 "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
84 "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
85 "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
86 "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
87 "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
88 "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
89 "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
90 "Ukraine", "United Arab Emirates", "United Kingdom",
91 "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
92 "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
93 "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"