我是android的新手.
我的自定义适配器在过滤时导致异常
这是我的代码.private class DeptAdapter extends ArrayAdapter implements Filterable {
private ArrayList<Dept> items;
private ArrayList<Dept> mOriginalValues;
public DeptAdapter(Context context, int textViewResourceId, ArrayList<Dept> items) {
super(context, textViewResourceId, items);
this.items = items;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.item_listview_2line, null);
}
Dept d = items.get(position);
if (d != null) {
TextView tt = (TextView) v.findViewById(R.id.toptext);
TextView bt = (TextView) v.findViewById(R.id.bottomtext);
if (tt …Run Code Online (Sandbox Code Playgroud) 我听说如果我不使用NDK开发Android游戏,性能就会明显降低.这是真的吗?