S
S
Sergey2018-04-04 02:47:31
Android
Sergey, 2018-04-04 02:47:31

How to create a service to store data on application close?

Hello.
Faced a question.
When closing the application, it is necessary to transfer part of the data to the service to prevent their loss, and also display a notification with a counter (your own, the standard time counter is not suitable).
Almost got it.
The data goes to the service, in the service itself I update the notification when the counter is updated, when you click on the notification, the data in the activity goes away.
But.
There is a question how to get data back not by clicking on the notification, but by opening the application normally?
It is necessary that both work.
I read everything I could find. Tell me how to act and what to read?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rostislav, 2018-04-04
Makkall @viogull

Perhaps in the onCreate() method of the Application class would suit you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question