print package net.ruixin.wbb;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
public class AutoCompleteTextViewActivity extends Activity {
String[] books = new String[] {
"疯狂java讲义",
"疯狂Android讲义",
"疯狂XML讲义",
"疯狂Workflow讲义"
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_auto_complete_text_view);
//创建一个ArrayAdapter,封装数组
ArrayAdapter
AutoCompleteTextView actv = (AutoCompleteTextView) findViewById(R.id.auto);
actv.setAdapter(aa);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.auto_complete_text_view, menu);
return true;
}
}
package net.ruixin.wbb;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
public class AutoCompleteTextViewActivity extends Activity {
String[] books = new String[] {
"疯狂java讲义",
"疯狂Android讲义",
"疯狂XML讲义",
"疯狂Workflow讲义"
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_auto_complete_text_view);
//创建一个ArrayAdapter,封装数组
ArrayAdapter
AutoCompleteTextView actv = (AutoCompleteTextView) findViewById(R.id.auto);
actv.setAdapter(aa);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.auto_complete_text_view, menu);
return true;
}
}
[html]
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:completionHint="请选择您喜欢的图书"
android:dropDownHorizontalOffset="100dp"
android:completionThreshold="1"
android:textColor="#000000" />
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:completionHint="请选择您喜欢的图书"
android:dropDownHorizontalOffset="100dp"
android:completionThreshold="1"
android:textColor="#000000" />
[html]
ArrayAdapter
ArrayAdapter
将java代码中的这一段改为
[html]
ArrayAdapter
ArrayAdapter