clickable layout like android alarm clock?
<p>I have layout like this: each row is clickable</p>

<pre><code>---------------------------
  stuff from database
---------------------------
 next entry from database
---------------------------
next entry
--------------------------
</code></pre>

<p>what i like to do is: first part of view "stuff from database" is going to have information on alarm clock such as time alarm goes off and days of the week ect and it clickable and the turn on part of the view is also clickable but should be able to get information from row next to it on same row as it because it needs information say id of alarm how do i do this?</p>

<hr>

<pre><code> stuff from database       |  turn on
--------------------------------------
 next entry from database  | turn on
--------------------------------------
next entry                 | turn on
---------------------------------------
</code></pre>

<p>this is the code i have:</p>

<pre><code> protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_activity);


        databaseHelper = new DatabaseStore(this);
        databaseHelper.open();
        ListViewData();

        registerForContextMenu(getListView());
    }


    private void ListViewData(){
         Cursor MainPageCursor = databaseHelper.fetchAllReminders();
         startManagingCursor(MainPageCursor);


         String[] empty = new String[] { DatabaseStore.MUTE_TITLE,  DatabaseStore.START_KEY_TIME, DatabaseStore.END_KEY_TIME, DatabaseStore.COVERT_DAYS }; 



            int[] notempty = new int[]{R.id.text1,R.id.text2, R.id.text4,  R.id.text5};
            SimpleCursorAdapter mainPageList = new SimpleCursorAdapter(this, R.layout.editinfo_row,MainPageCursor, empty, notempty);
           setListAdapter(mainPageList); 


          }

protected void onListItemClick(ListView l, View v, int position, long id){
    super.onListItemClick(l, v, position, id);
    Intent i = new Intent(this, AddTimeEntry.class); /// fix this back to wha tit was
    i.putExtra(DatabaseStore.kEY_ROWID, id);
     startActivityForResult(i, ACTIVITY_EDIT); 

}
</code></pre>

<p>editinfo_tow.xml</p>

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

 &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/widget38"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginLeft="10dip"
        android:layout_marginRight="10dip"
        android:orientation="vertical" &gt;

        &lt;TextView
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/text1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:textSize="25sp" /&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" &gt;


            &lt;TextView
                android:id="@+id/text2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="30sp" /&gt;
    &lt;TextView
                android:id="@+id/text3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text=" - "
                android:textSize="30sp" /&gt;
            &lt;TextView
                android:id="@+id/text4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="30sp" /&gt;

             &lt;CheckBox
                  android:text=""
        android:id="@+id/list_checkbox"
      android:layout_marginLeft="20dp"
       android:layout_width="wrap_content"
                android:layout_height="wrap_content"
        android:checked="false"
        android:focusable="false"
android:focusableInTouchMode="false"
        /&gt;

&lt;/LinearLayout&gt;



  &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" &gt;
            &lt;TextView
                android:id="@+id/text5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="15sp" /&gt;

        &lt;/LinearLayout&gt;

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

<p>update </p>

<pre><code>public void addListenerOnButton() {

    final ToggleButton toggleButton1 = (ToggleButton) findViewById(R.id.toggleButton1);
    //toggleButton2 = (ToggleButton) findViewById(R.id.toggleButton2);
    Button btnDisplay = (Button) findViewById(R.id.toggleButton1);

    btnDisplay.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

          // StringBuffer result = new StringBuffer();
          // result.append("toggleButton1 : ").append(toggleButton1.getText());
    //     result.append("\ntoggleButton2 : ").append(toggleButton1.getText());

         //  Toast.makeText(MyAndroidAppActivity.this, result.toString(),
            //Toast.LENGTH_SHORT).show();

        }

    });

 }
</code></pre>

<p>i used that code above and i get null pointer exception?</p>
