Reputation: 7554
What is the lifetime of a ContentProvider in Android? After onCreate()
is invoked, will the ContentProvider persist unconditionally for the lifetime of the process?
My ContentProvider manages a list of records, but only 1 is designated "active" and will be accessed by different applications a lot. I was wondering if it's safe to cache the index of this active record in memory as a member of my ContentProvider to speed up lookup.
Upvotes: 2
Views: 663
Reputation: 1007359
After onCreate() is invoked, will the ContentProvider persist unconditionally for the lifetime of the process?
Yes.
Upvotes: 4