Jumat, 04 November 2011

MultiAutoCompleteTextView

| |


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

    }
}


0 komentar:

Posting Komentar



kelompok11d4itb



Daftar Isi

Tentang Kami

Foto saya
Nama Anggota Kelompok : * CALIANDRA TRINANDA * RIZAL HANAFI * M. SAKTI FACHRI * VYTA PRATAMI NINGSIH

Pengikut

PengUnJung KeeEee????

Diberdayakan oleh Blogger.
 
 

Designed by: ▓░^Vhye_muuTh^░VytÃ░▓
Scrapping elements by: Coklat© 4