Android Question FCM store messages and show in customlistview


Active Member
Licensed User
Longtime User
How's everybody?

I'm finishing a job with FCM
My question is, can you help me with an example of how to save the messages once received to show them in a Customlistview, whenever you need it.
What happens now is that when I left and re-entered I lost the messages.



Licensed User
Longtime User
What is stopping you from saving the incoming message (topic and body) into a sqlite database?

You can then use the SQLite-Table to query the Niotifications and show them in a CLV...
Last edited:
Upvote 0


Active Member
Licensed User
Longtime User
Thank you very much for the suggestions.
I will try with SQLite How
I would like to have the knowledge that you have
I hope to make it regards
It also depends what you want to do with those messages. Are you going to search for a particular message, or just display all messages received.
If you are not going to do any sorting, searching for messages then you can simply do something like this.
Sub Process_Globals
    Type FCMMsg( topic As String, body As String)
    Dim msgList As List
End Sub

Sub newFcmMsg(topic As String, body As String)
    Dim newMsg As FCMMsg
    newMsg.body = body
    newMsg.topic = topic
    If Not(msgList.IsInitialized) Then     'you can initialize the list somewhere else
    End If
End Sub

Sub readMsg(index as Int)
    Dim msg As FCMMsg
    msg = msgList.Get(index)
    Dim topic as String = msg.topic
    Dim body as String = msg.body
End Sub

You don't need any database for this.
When you get a new message call sub newFcmMsg to add it to the list. You can delete messages from the list. You can save the list to the file and access it any time.
Upvote 0