package com.android.vyta; import android.app.Activity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.LinearLayout; import android.widget.MultiAutoCompleteTextView; import android.widget.TextView; public class MACTextViewVytaActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LinearLayout ly=new LinearLayout(this); TextView txt=new TextView(this); txt.setText("Nama kota di Indonesia : "); ly.addView(txt); MultiAutoCompleteTextView mactv = new MultiAutoCompleteTextView(this); ArrayAdapter<String> aa2 = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line,new String[] {"Bukittinggi", "Jakarta", "Surabaya", "Bali", "Semarang","Balikpapan"}); mactv.setAdapter(aa2); mactv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); mactv.setWidth(500); mactv.setHeight(50); ly.addView(mactv); setContentView(ly); } } |
Jumat, 04 November 2011
MultiAutoCompleteTextView
Diposting oleh kelompok11d4itb | di 10.15 |
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar