- private class MyBlackNumAdapter extends BaseAdapter {
- class ViewHolder {
- SwitchImageView siv_cs_del;
- }
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View view;
- ViewHolder holder = null; //1
- if (convertView == null) {
- view = View.inflate(CallSmsSafeActivity.this, 1, null);
- holder = new ViewHolder(); //2
- holder.siv_cs_del = (SwitchImageView) view.findViewById(R.id.siv_cs_del);
- view.setTag(holder);
- }
- holder.siv_cs_del.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- holder.siv_cs_del.changeStatus(); //3
- }
- });
- return view;
- }
- }
复制代码 位置3让把位置1final,但是这样的话,位置2又让位置1取消final,我想在位置3使用这个holder 该怎么弄
|
|