tags:

views:

32

answers:

1

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.

+1  A: 

After onCreate() is invoked, will the ContentProvider persist unconditionally for the lifetime of the process?

Yes.

CommonsWare