theactiveactor
theactiveactor

Reputation: 7554

Android: What is the lifetime of a ContentProvider?

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

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007359

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

Yes.

Upvotes: 4

Related Questions