As a service to get data at startup, for example, there is an application activation, by it switching to the activation settings. there is a set of parameters as an example of a login or check box is worth it or not. From the activation of parameters it is easy to transfer to the service a band or receiver, if the service starts at startup, the application did not start. How can the service get parameters from the activation settings. Tell me who knows? In the settings, I save the ativi through sharpereferens but how to get the data to the service when autoloading?

Update

Well, I’m trying to get through a value-referencing sort of like it saves it in a file, and when loading it loads the previously entered box or the check box. If I write a workload code in the service, that is, load the field entered in the activation settings in the service, then the username [ 08-12 20:19:22.483 18925:0x49ed D/MyLogs ] . I understand that this is because of privatmod. In theory, private mode is available to the application, that is, to the service and other activations in this application. Or is it not true?

  • 2
    Try to formally describe what you have and what you want to get in the end. Now it is difficult to isolate the necessary information from your message. - Timofei Bondarev
  • one
    Maybe the same - from shared preference? - Chad
  • Yes, it turned out from the shared prerequisites, you need to use the hetshared preference and not the get preference (for the current activation, as I understand it - netfinity

2 answers 2

I decided everything through shared preference. activates the file and the service takes it from the file.

  • one
    It seems to me that this information is not enough for future readers to use this solution. Could you give more detailed instructions? - Nick Volynkin

I think you need to reconsider the dependencies of your components.
The service itself must store the settings, since it starts first and it needs them.
And the activit should read and change them through the methods of the service.
Then everything will be in one place and work correctly.

  • Yes, thanks for the advice. So far I have decided everything through shared preference. - netfinity pm