copying view objects
<p>I have a ListView that I am populating with LinearLayouts that contain one CheckBox apiece.  The LinearLayout's are added dynamically for each object I am returning from a web service I have.
I need for a user to be able to click a done button and for the application to go through the list of CheckBox's and update a database for each checked item.  The database and the done button were a piece of cake, but obtaining a reference to or making a copy, how ever you choose to look at it, of the CheckBox thus far has stumped me for days.</p>

<p>my code as of now for this process looks something like this:</p>

<p>private ListView List = (ListView)findViewById(R.id.list);</p>

<p>LinearLayout temp;
CheckBox curr;</p>

<p>for ( int i = 0; i&lt; List.getChildCount(); i++) {
   temp = (LinearLayout)List.getChildAt(i);
   curr = (CheckBox)temp.getChildAt(1);
   if ( curr.isChecked() ) {
      //do stuff here
   }
}</p>

<p>as soon as I try and reference either the temp object or the curr object the program crashes.  So in the above code it crashes at curr.isChecked().  I discovered previously that if you forget that the CheckBox is wrapped in a LinearLayout and try to copy a LinearLayout object to a CheckBox object the program crashes, so I know the system sees the correct object to copy, even at the curr copy... however if i try to log the temp class type like this
Log.d("temp Class type", temp.getClass().toString());
the system crashes</p>

<p>However the following works perfectly fine...
Log.d("List Class type", List.getChildAt(i).getClass().toString());</p>

<p>The only thing I can come up with at this point is that I need to overload a copy construct somewhere, but I can not find anything that advises you on how to begin this or what the copy function might be called.  Even google code searches have proved fruitless for me...</p>

<p>I have a feeling this is just something I am looking at completely 180 degrees the wrong way and it is going to be ridiculously simple, but if there were a way to rip the emulator off the screen and throw it through the wall I would have done it by now, please help!</p>

<p>-David</p>

<p>...and thanks in advance.</p>
