Please help i have two table the sent messages table and the recieved messages table how can i be in position to save the conversation on the chat also be in position to delete some conversation
sent sms table has fields below how can i be in position to save the conversation on this chat. so that when i click on chat i can be in position to view the previous communication. Note: for example on whatsapp you can be in position to see previous conversation and last reply from that conversation on one layout thanks.
find attached the example of the chat . the problem i have is when i close it the conversation is cleared
To save the conversation, maybe you could start with this:
B4X:
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then
<save your conversation here>
End If
End Sub
Sub Activity_Resume
<restore your conversation here>
End Sub
To delete some conversation, you can improve this code:
Chat.bas:
B4X:
Private Sub AddItem (Text As String, Right As Boolean)
Dim p As B4XView = xui.CreatePanel("pnl") 'CODE CHANGE: insert the eventName = "pnl"
(...)
End Sub
Sub pnl_LongClick
'CODE CHANGE: remove the panel with conversation using a long click
Dim pn As Panel = Sender
pn.RemoveView
End Sub