編輯:關於android開發
java.lang.Object;
android.view.View;
android.view.TextView;
android.widget.EditText;
android.widget.AutoCompleteTextView;
MultiAutoCompleteTextView;
完整工程:http://download.csdn.net/detail/sweetloveft/9408072
下述程序中主要學習 AutoCompleteTextView 的使用方法,該控件無法在布局文件中指定 android:entries,暫時沒有查證有沒有其他指定的方法,因此決定采用代碼加載!另一個需要注意 layout 中
package com.sweetlover.activity; import com.sweetlover.autocompletetextviewdemo.R; import android.app.Activity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; public class MainActivity extends Activity { private static final String[] phoneNumber = new String[]{ "111234", "133126", "303404", "796863" }; private AutoCompleteTextView autoTextView = null; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ArrayAdapteradapter = new ArrayAdapter (this, android.R.layout.simple_dropdown_item_1line, phoneNumber); autoTextView = (AutoCompleteTextView)findViewById(R.id.autoCompleteTextView1); autoTextView.setAdapter(adapter); } }
<!--{cke_protected}{C}%3C!%2D%2D%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%2D%2D%3E--> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="30dp" android:orientation="vertical"> <autocompletetextview android:id="@+id/autoCompleteTextView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:hint="@string/note" android:ems="20"> <requestfocus> <!--{cke_protected}{C}%3C!%2D%2D%20http%3A%2F%2Fzhangkun716717-126-com.iteye.com%2Fblog%2F802201%20%2D%2D%3E--> </requestfocus></autocompletetextview> </linearlayout>
<resources> <string name="app_name">AutoCompleteTextViewDemo</string> <string name="note">輸入電話號碼</string> </resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sweetlover.autocompletetextviewdemo" android:versioncode="1" android:versionname="1.0"> <uses-sdk android:minsdkversion="8" android:targetsdkversion="19"> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> <activity android:name="com.sweetlover.activity.MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"> <category android:name="android.intent.category.LAUNCHER"> </category></action></intent-filter> </activity> </application> </uses-sdk></manifest>
推送:騰迅信鴿 VS Bmob,信鴿bmob最近幾天了解市場上主流的推送SDK。 騰迅信鴿 所需SDK,去官網自行下載。去下載 完整的清單文件如下: 1
Activity詳解一 配置、啟動和關閉activity,activity詳解先看效果圖: Android為我們提供了四種應組件,分別
Android 面試題--Activity,android--activity1、什麼是 Activity?Activity是Android組件中最基本也是最為常見用的四
在Android上使用qemu-user運行可執行文件,androidqemu-user在Android上使用qemu-user運行可執行文件 作者:尋禹@阿裡聚安全 &