WEB开发网
开发学院手机开发Android 开发 通过改写ArrayAdapter 用AutoCompleteTextView 实... 阅读

通过改写ArrayAdapter 用AutoCompleteTextView 实现汉字和拼音双向关联

 2010-07-15 20:43:00 来源:WEB开发网   
核心提示:T[] objects,T[] objects2) {init(context, resource, textViewResourceId, Arrays.asList(objects),Arrays.asList(objects2));}/*** Constructor** @param context The cu
T[] objects,T[] objects2) {

init(context, resource, textViewResourceId, Arrays.asList(objects),Arrays.asList(objects2));

}

/**

* Constructor

*

* @param context The current context.

* @param textViewResourceId The resource ID for a layout file containing a TextView to use when

* instantiating views.

* @param objects The objects to represent in the ListView.

*/

public CityAdapter(Context context, int textViewResourceId, List objects,List objects2) {

init(context, textViewResourceId, 0, objects,objects2);

}

/**

* Constructor

*

* @param context The current context.

* @param resource The resource ID for a layout file containing a layout to use when

* instantiating views.

* @param textViewResourceId The id of the TextView within the layout resource to be populated

* @param objects The objects to represent in the ListView.

*/

public CityAdapter(Context context, int resource, int textViewResourceId, List objects,List objects2) {

init(context, resource, textViewResourceId, objects, objects2);

}

/**

* Adds the specified object at the end of the array.

*

* @param object The object to add at the end of the array.

*/

public void add(T object) {

if (mOriginalValues != null) {

synchronized (mLock) {

mOriginalValues.add(object);

if (mNotifyOnChange) notifyDataSetChanged();

}

} else {

mObjects.add(object);

if (mNotifyOnChange) notifyDataSetChanged();

}

}

/**

* Inserts the specified object at the specified index in the array.

*

上一页  1 2 3 4 5 6 7 8  下一页

Tags:通过 改写 ArrayAdapter

编辑录入:coldstar [复制链接] [打 印]
赞助商链接