Android Question how store and show previous conversation

Makumbi

Well-Known Member
Licensed User
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
 

Attachments

  • Backup Chat 2019-12-31 16.31.zip
    11.1 KB · Views: 59

asales

Well-Known Member
Licensed User
Longtime User
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
 
Upvote 0

asales

Well-Known Member
Licensed User
Longtime User
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
 
Upvote 0
Top