Your service could possibly maintain a database with the detail. If you take that approach, you might also listen for ON_BOOT and, when received, make sure your database gets reset.
On May 19, 7:11 pm, irbaboon <[email protected]> wrote: > Hi, > > I'm developing an application which consists of two different > activities which edit files. The two activities run in separate > processes. Multiple instances of both activities can be launched > concurrently in different tasks. Each activity instance is passed a > file path to work on in its intent. I'd like to make it so that a > given file cannot be edited in more than one activity instance at the > same time. > > As far as my understanding goes, I have to use a Service. Each > activity instance must ask the service whether it is allowed to > acquire the "editing rights" for the file passed in its intent. The > service will keep a set of open files. Set entries will be removed > when activity instances are closed. > > The problem is that the service process can be killed at almost any > time. There is not any method like Activity.saveInstanceState(...) in > Service. How is the set of open files supposed to persist an eventual > killing and later re-launching of the service process? > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

