-1
iam이 애플리케이션 백업 앱에서 작업 중이므로 확인란을 선택하여 선택한 애플리케이션 만 백업합니다. 나는 체크 박스를 목록에 구현했지만 체크를하면 9 행마다 행을 검사 할 때 다음과 같이 체크된다 : S모든 9 번째 행이 확인됩니다.
PS. 그래서 앱 백업도 :
작업 whay 내가 할 수 어떻게 유일한 어떤 하나
private static class AppViewHolder {
TextView top_view;
TextView bottom_view;
ImageView icon;
CheckBox check_mark;
//@SuppressWarnings("unused")
}
private class TableView extends ArrayAdapter<ApplicationInfo> {
private TableView() {
super(main.this, R.layout.tablerow_02, mAppList);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
AppViewHolder holder;
ApplicationInfo info = mAppList.get(position);
if(convertView == null) {
LayoutInflater inflater = getLayoutInflater();
convertView = inflater.inflate(R.layout.tablerow_02, parent, false);
holder = new AppViewHolder();
holder.top_view = (TextView)convertView.findViewById(R.id.top_view);
holder.bottom_view = (TextView)convertView.findViewById(R.id.bottom_view);
holder.check_mark = (CheckBox)convertView.findViewById(R.id.checkBox1);
holder.icon = (ImageView)convertView.findViewById(R.id.row_image);
holder.icon.setMaxHeight(40);
convertView.setTag(holder);
} else {
holder = (AppViewHolder) convertView.getTag();
}
holder.check_mark.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
if (isChecked)
{
Toast.makeText(getApplicationContext(), "#" + position + " is checked", Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(getApplicationContext(), "#" + position + " is unchecked", Toast.LENGTH_LONG).show();
}
}
});
holder.top_view.setText(info.loadLabel(getPackageManager()));
holder.bottom_view.setText(info.packageName);
//this should not throw the exception
try {
holder.icon.setImageDrawable(mPackMag.getApplicationIcon(info.packageName));
} catch (NameNotFoundException e) {
holder.icon.setImageResource(R.drawable.ic_launcher);
}
return convertView;
}
}