通过改写ArrayAdapter 用AutoCompleteTextView 实现汉字和拼音双向关联
2010-07-15 20:43:00 来源:WEB开发网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
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
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.
*
Tags:通过 改写 ArrayAdapter
编辑录入:coldstar [复制链接] [打 印]更多精彩
赞助商链接