Package Com. turboradio. googlesdk;
Import Android. App. activity;
Import Android. OS. Bundle;
Import Android. widget. arrayadapter;
Import Android. widget. autocompletetextview;
Public Class Ex_4_13 Extends Activity {
Private Static Final String [] autostr = {
"A", "ABC", "ABCD", "ACD"
};
Private Autocompletetextview AutoText;
@ Override
Protected Void Oncreate (bundle savedinstancestate ){
Super . Oncreate (savedinstancestate );
Setcontentview (R. layout. ex_4_13 );
Arrayadapter <string> adapter = New Arrayadapter <string> ( This , Android. R. layout. simple_dropdown_item_1line, autostr );
AutoText = (autocompletetextview) findviewbyid (R. Id. Auto );
AutoText. setadapter (adapter );
}
}
Ex_4_13.xml
<? XML version = "1.0" encoding = "UTF-8"?>
<Linearlayout xmlns: Android = "http://schemas.android.com/apk/res/android"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: Orientation = "vertical">
<Textview
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
Android: text = "enter"
/>
<Autocompletetextview
Android: Id = "@ + ID/auto"
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
/>
</Linearlayout>