package com.android.liu.widget;
import com.android.liu.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.MultiAutoCompleteTextView;
public class AutoCompleteActivity extends Activity {
public static final String[] m_autoComlete = { "a2", "abf", "abe", "abcde",
"abc2", "abcd3", "abcde2", "abcd2", "abcde2" };
@Override
public void onCreate(Bundle saveInstateSave) {
super.onCreate(saveInstateSave);
setContentView(R.layout.autocomplete);
//关联关键字
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line, m_autoComlete);
// AutoCompleteTextView m_AutoCompleteTextview = (AutoCompleteTextView) this
// .findViewById(R.id.AutoCompleteTextView01);
// m_AutoCompleteTextview.setAdapter(adapter);
MultiAutoCompleteTextView m_MulitAutoCompleteTextview = (MultiAutoCompleteTextView) this
.findViewById(R.id.MultiAutoCompleteTextview01);
//将Adapter添加到MultiAutoCompleteTextView
m_MulitAutoCompleteTextview.setAdapter(adapter);
//设置将被 确定的标记生成器
m_MulitAutoCompleteTextview.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.liu"
android:versionCode="1"
debuggable="TRUE"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".widget.AutoCompleteActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity2"/>
<activity android:name=".activity.SecondActivity"/>
<activity android:name=".broadcast.DisplayActivity"/>
<activity android:name=".sqlite.QueryActivity"/>
<activity
android:name=".ui.MainActivity"
android:theme="@android:style/Theme.Translucent"
android:icon="@drawable/icon"
/>
<activity android:name="SecondActivity">
<intent-filter>
<action android:name="com.android.liu.intent.app" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<Service android:name=".service.FirstService">
<intent-filter>
<action android:name="com.android.liu.service.action.MY_ACTION"/>
</intent-filter>
</Service>
<receiver android:name=".broadcast.FirstReceiver">
<intent-filter>
<action android:name="com.android.liu.action.MY_ACTION"/>
</intent-filter>
</receiver>
<receiver android:name=".broadcast.SecondReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<receiver android:name=".broadcast.MainReceiver">
<intent-filter>
<action android:name="com.android.liu.actoin.BC_ACTION"/>
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.HARDWARE_TEST"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE"></uses-permission>
</manifest>