Here is the code Erel.
The GetIfChecked Sub is checking if the checkbox is checked or not by retrieving from DB.
The CreateListItem creates the each item in the list along with checkbox.
The chk_CheckedChange is called each time the value of the checkbox
As you can see in the code. I am programatically setting the value of the checkbox when first creating the view and the sub chk_CheckedChange is called since the checkbox value is changed.
Now since the Sender is null it is throwing a NULL Pointer Exception.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Kindly let me know the if i am making any mistake.
Regards,
SK
			
			The GetIfChecked Sub is checking if the checkbox is checked or not by retrieving from DB.
The CreateListItem creates the each item in the list along with checkbox.
The chk_CheckedChange is called each time the value of the checkbox
As you can see in the code. I am programatically setting the value of the checkbox when first creating the view and the sub chk_CheckedChange is called since the checkbox value is changed.
Now since the Sender is null it is throwing a NULL Pointer Exception.
			
				B4X:
			
		
		
		Sub CreateListItem(Text As String, Width As Int, Height As Int,chkflglan As Int) As Panel
    Dim p As Panel
    p.Initialize("")
    p.Color = Colors.Black
  
    chk.Initialize("chk")
    Dim lbl As Label
    lbl.Initialize("")
    lbl.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.LEFT)
    lbl.Text = Text
    lbl.TextSize = 20
    lbl.TextColor = Colors.White
  
    getIfCheked(chkflglan)
'Setting the Exisiting value for CheckBox
    If (CheckBoxFlag == True) Then
            chk.Checked = True
    End If
  
    p.AddView(lbl, 5dip, 2dip, 150dip, Height - 4dip) 'view #0
    p.AddView(chk, 280dip, 2dip, 50dip, Height - 4dip) 'view #2
    Return p
End Sub
Sub getIfCheked(langval As Int)
    Dim m As Map
    m = DBUtils.ExecuteMap(SQL, "SELECT Flag FROM languageSettings WHERE Language = ?", _
        Array As String(lan.lanlist(langval)))
    Log (" ** For Checkbox Query Result ** "& m.GetValueAt(0))
    If ((m.Get("flag") = Null) OR (m.Get("flag") = "0")) Then
        CheckBoxFlag = False
    End If
    If ((m.Get("flag")) = "1") Then
        CheckBoxFlag = True
    End If
End Sub
Sub chk_CheckedChange(Checked As Boolean)
        Dim index As Int
        index = clv1.GetItemFromView(Sender)
        Log("*** Sender **"&Sender)
        Dim pnl As Panel
        pnl = clv1.GetPanel(index)
        Dim chk1 As CheckBox
        chk1.Initialize("chk1")
        chk1= pnl.GetView(1)
        Log("Item value: " & clv1.GetValue(index) &"Check value: " & chk1.Checked)
        updateInDB(clv1.GetValue(index),chk1.Checked)
End SubKindly let me know the if i am making any mistake.
Regards,
SK
 
				 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
			