Need help passing Checkbox Text into new multiple checkboxes for each checkbox selected!!

I have set up where my checkboxes when checked get sent to anther checkbox on a separate activity. I need to figure out how to move each selected checkbox to its own checkbox. Here is the code I have right now that sends all of the selected checkboxes to the other activity page as one checkbox.

[Activity (Label = "Songression")]
public class numbersActivity : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
//Variables
SetContentView (Resource.Layout.numbers);
CheckBox cb0 = FindViewById (Resource.Id.checkBox0);
CheckBox cb1 = FindViewById (Resource.Id.checkBox1);
CheckBox cb2 = FindViewById (Resource.Id.checkBox2);
CheckBox cb3 = FindViewById (Resource.Id.checkBox3);
Button button0 = FindViewById (Resource.Id.button0);
//Back Button
button0.Click += delegate {
StartActivity(typeof(MainActivity));
};
//Get Results button
Button button01 = FindViewById (Resource.Id.button01);
button01.Click += delegate {
if (cb0.Checked) {
myResources.result100 += cb0.Text + System.Environment.NewLine;

                };
        if (cb1.Checked) {
            myResources.result100 += cb1.Text + System.Environment.NewLine;

                };
        if (cb2.Checked) {
            myResources.result100 += cb2.Text + System.Environment.NewLine;
                };
        if (cb3.Checked) {
            myResources.result100 += cb3.Text + System.Environment.NewLine;
                };
        StartActivity (typeof(results));
    };
}

}
}

Here is the code for the results page that the checkboxes are suppoed to be sent to

[Activity (Label = "Songression")]
public class results : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.results);
//Variables

    CheckBox post = FindViewById<CheckBox> (Resource.Id.result100);
    post.Text = myResources.result100;

    //Back Button
    Button button0 = FindViewById<Button> (Resource.Id.button0);
        button0.Click += delegate {
            StartActivity(typeof(MainActivity));
            };
    //Save Button
    Button buttonS = FindViewById<Button> (Resource.Id.buttonS);
        buttonS.Click += delegate {
    };
}

}
}

Here is the xml for the results page

`

    <CheckBox
        android:text="CheckBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/result100" />
</LinearLayout>

Sign In or Register to comment.