Creating a list with checkbox's on andriod (Using list view)
<p>(Im developing for andriod 2.3.3) I have a word document full of data that i would like to display as a list with checkbox's. I would like the program to store if a item on the list has been checked for the next time the application is run, i have a list view inside a custom dialouge ready to put this in and any help would be great (i can put my current code into here if needed)  Thanks in advance :)</p>

<p>Main Window:`</p>

<pre><code>package kevin.erica.box;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import java.io.IOException;
import java.util.Random;

public class TheKevinAndEricaBoxActivity extends Activity {
/** Called when the activity is first created. */
private String[] myString;
private String list;
private String[] myString2;
private String list2;
private static final Random rgenerator = new Random();
private static final Random rgenerator2 = new Random();
MediaPlayer mp;
final Context mContext = this;
final Context context = this;
private Button button;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Resources res = getResources();


    myString = res.getStringArray(R.array.myArray);

    list = myString[rgenerator.nextInt(myString.length)];

    myString2 = res.getStringArray(R.array.myArray2);

    list2 = myString2[rgenerator.nextInt(myString2.length)];



    ImageButton ib = (ImageButton) findViewById(R.id.imagebutton1);
    ib.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View erica) {
            AlertDialog.Builder b = new AlertDialog.Builder(
                    TheKevinAndEricaBoxActivity.this);
            b.setMessage(myString[rgenerator.nextInt(myString.length)]);
            b.setTitle(R.string.title1);
            b.setIcon(R.drawable.menuiconerica);
            b.setPositiveButton("Back",
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog,
                                int which) {
                            dialog.cancel();
                        }
                    });
            Dialog d = b.create();
            d.show();
        }
    });

    ImageButton ib2 = (ImageButton) findViewById(R.id.imagebutton2);
    ib2.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View kevin) {
            AlertDialog.Builder b = new AlertDialog.Builder(
                    TheKevinAndEricaBoxActivity.this);
            b.setMessage(myString2[rgenerator2.nextInt(myString2.length)]);
            b.setTitle(R.string.title2);
            b.setIcon(R.drawable.menuiconkevin);
            b.setPositiveButton("Back",
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog,
                                int which) {
                            dialog.cancel();
                        }
                    });
            Dialog d = b.create();
            d.show();

        }
    });


    ImageButton Ib3 = (ImageButton) findViewById(R.id.imagebutton3);
    Ib3.setOnClickListener(new View.OnClickListener() {
        public void onClick(View lemonclick) {
            mp = MediaPlayer.create(getApplicationContext(),R.raw.lemonspeech);
            mp.start();


        }
    });
    button = (Button) findViewById(R.id.button01);

    // add button listener
    button.setOnClickListener(new OnClickListener() {

      @Override
      public void onClick(View arg0) {

        // custom dialog
        final Dialog dialog = new Dialog(context);
        dialog.setContentView(R.layout.list);
        dialog.setTitle("The List");

        // set the custom dialog components - text, image and button
        TextView text = (TextView) dialog.findViewById(R.id.TextView01);
        text.setText("Did you not read the button? :P i'm not finshed on this yet XD");

        Button dialogButton = (Button) dialog.findViewById(R.id.Button01);
        // if button is clicked, close the custom dialog
        dialogButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

        dialog.show();
      }
    });
    }
</code></pre>

<p>}
`
My xml for the custom dialouge</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;


&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;



    &lt;Button
        android:id="@+id/Button01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:text="Back" /&gt;

    &lt;TextView
        android:id="@+id/TextView01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:text="TextView" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>
