Change in User Interface from inside CompoundButton.OnCheckedChangeListener() using non-Activity Class
<p>I am writing a code, in which I am creating dynamic <code>Checkboxes</code> with their <code>ActionListener</code> from a <code>non-Activity</code> Class.</p>

<p>Now I want to change some User Interface from the <code>CompoundButton.OnCheckedChangeListener()</code>.</p>

<p>Each <code>checkbox</code> represents an alarm. In <code>Database</code> each alarm is set with a <code>column</code> specifying whether the alarm is enabled or disabled, I need to access the database for doing that. I am writing following code:</p>

<pre><code>public class DataBaseAdapter extends SQLiteOpenHelper 
{
    ....
    .... //onCreate, onUpdate, other methods used.
    ....
public TableLayout getAllAlarmList(Context con)
{
    SQLiteDatabase db = this.getReadableDatabase();
    for(int i=0;i&lt;maxCount;i++) //maxCount number of rows in database
    {
        check[i]= new CheckBox(con);
        check[i].setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
        {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
            {
                if(isChecked)
                {

                }
                else
                {

                }
            }
        });
    }

}
</code></pre>

<p>Now I need to add code in here which enables me to add Database access codes. How to do it.?</p>
