0

I have a background service that receive notification data messages and i want that is the main activity of the app who will process then. When the main activity is running, i can send the data message to it via LocalBroadcastManager, but my problem is when the main activity is not running ! How the service can send message to the main activity in the way that the main activity will receive the message when it's will start ?

zeus
  • 12,173
  • 9
  • 63
  • 184

1 Answers1

1

you can save that data in local storage either database or shared preference and when your activity starts check for the value and proceed accordingly.

Also you can save custom array list too in shared preference using gson library easily

Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84