Problem with checkbox
<p>Anyone please clarify my doubts in this program : -</p>

<p>BackUpActivity.java : -</p>

<pre><code>public class BackUpActivity extends Activity
{
//Use ArrayList to store the installed non-system apps
ArrayList&lt;AppInfo&gt; appList = new ArrayList&lt;AppInfo&gt;();

//ListView app_listView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

//        List&lt;ApplicationInfo&gt; packages = getPackageManager().getInstalledApplications(0);
    List&lt;PackageInfo&gt; packages = getPackageManager().getInstalledPackages(0);
    for(int i=0; i&lt;packages.size(); i++)
    { 
        PackageInfo packageInfo = packages.get(i);
        AppInfo tmpInfo = new AppInfo();
        tmpInfo.appName =     packageInfo.applicationInfo.loadLabel(getPackageManager()).toString(); 
        tmpInfo.packageName = packageInfo.packageName; 
        tmpInfo.versionName = packageInfo.versionName; 
        tmpInfo.versionCode = packageInfo.versionCode; 
        tmpInfo.appIcon = packageInfo.applicationInfo.loadIcon(getPackageManager());
        //  Only display the non-system app info
        if((packageInfo.applicationInfo.flags&amp;ApplicationInfo.FLAG_SYSTEM)==0)
        {
            appList.add(tmpInfo);
        }
    }
    for(int i=0;i&lt;appList.size();i++)
    {
        appList.get(i).print();
    }

    //Populate data to listView
    ListView app_listView=(ListView)findViewById(R.id.listview1);
    AppAdapter appAdapter=new AppAdapter(BackUpActivity.this,appList);

    //app_listView.setAdapter(appAdapter);
    app_listView.setDividerHeight(5);
    if(app_listView!=null)
    {
        app_listView.setAdapter(appAdapter);
    }
}
public class AppAdapter extends BaseAdapter 
{
    Context context;
    ArrayList&lt;AppInfo&gt; dataList=new ArrayList&lt;AppInfo&gt;();
    public AppAdapter(Context context,ArrayList&lt;AppInfo&gt; inputDataList)
    {
        this.context=context;
        dataList.clear();
        for(int i=0;i&lt;inputDataList.size();i++)
        {
            dataList.add(inputDataList.get(i));
        }
    }
    @Override
    public int getCount()
    {
        // TODO Auto-generated method stub
        return dataList.size();
    }

    @Override
    public Object getItem(int position)
    {
        // TODO Auto-generated method stub
        return dataList.get(position);
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent)
    {           
        View v=convertView;
        final AppInfo appUnit=dataList.get(position);
        if(v==null)
        {
            LayoutInflater vi=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v=vi.inflate(R.layout.app_row, null);
            v.setClickable(true);
        }
        TextView appName=(TextView)v.findViewById(R.id.appName);
        ImageView appIcon=(ImageView)v.findViewById(R.id.icon);
        if(appName!=null)
            appName.setText(appUnit.appName);
        if(appIcon!=null)
            appIcon.setImageDrawable(appUnit.appIcon);
        return v;
    }
}
public boolean onCreateOptionsMenu(Menu menu) 
 {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu, menu);
    return true;
 }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) 
    {
        switch (item.getItemId())
        {               
            case R.id.BackUp:
            try
            {
                backup();
            }catch(Exception e){}                                   
//                  finish();
                break;
            case R.id.CheckAll:
                try
                {
                    checkall();
                }catch(Exception e){e.notify();}
                break;
            case R.id.Cancel:
            try
            {
                cancel();
            }catch(Exception e){}
            break;
        }
        return true;
    }
    public void backup()
    {
        Toast.makeText(this, "Backup Data", Toast.LENGTH_SHORT).show();
    }
    public void checkall()
    {
        CheckBox c = (CheckBox)this.findViewById(R.id.checkBox1);
        if (c.isChecked())
        { 
            c.setChecked(false); 
        } 
        else 
        {
            c.setChecked(true);
        }
    }
    public void cancel()
    {
        finish();
    }
}
</code></pre>

<p>AppInfo.java</p>

<pre><code>package com.android.backup;

import android.graphics.drawable.Drawable;
import android.util.Log;

public class AppInfo 
{
public String appName="";
public String packageName="";
public String versionName="";
public int versionCode=0;
public Drawable appIcon=null;

public void print()
{
    Log.v("app","Name:"+appName+" Package:"+packageName);
    Log.v("app","Name:"+appName+" versionName:"+versionName);
    Log.v("app","Name:"+appName+" versionCode:"+versionCode);
}
}
</code></pre>

<p>It's showing the results not properly, if i'm going to select the checkall button, it'll not work properly.</p>
