|
@@ -51,12 +51,13 @@ class ButtonItemAdapter extends BaseAdapter implements View.OnClickListener {
|
|
@SuppressLint("ViewHolder")
|
|
@SuppressLint("ViewHolder")
|
|
@Override
|
|
@Override
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
- View view = View.inflate(mContext, R.layout.dialog_customlistitem, null);
|
|
|
|
- ((TextView) view.findViewById(R.id.title)).setText(mItems[position] + " (" + position + ")");
|
|
|
|
- Button button = (Button) view.findViewById(R.id.button);
|
|
|
|
|
|
+ if (convertView == null)
|
|
|
|
+ convertView = View.inflate(mContext, R.layout.dialog_customlistitem, null);
|
|
|
|
+ ((TextView) convertView.findViewById(R.id.title)).setText(mItems[position] + " (" + position + ")");
|
|
|
|
+ Button button = (Button) convertView.findViewById(R.id.button);
|
|
button.setTag(position);
|
|
button.setTag(position);
|
|
button.setOnClickListener(this);
|
|
button.setOnClickListener(this);
|
|
- return view;
|
|
|
|
|
|
+ return convertView;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|