سؤال

Can shutdown() be used for clean up operations in Android content provider? Is shutdown() called automatically when activity is destroyed or does it have to be invoked manually & for testing purposes only? Is it a bad practice to invoke it in production code?

هل كانت مفيدة؟

المحلول

If you are referring to shutdown() on ContentProvider, it is never called, unless you call it. Moreover, you should really only call it in unit testing. After all, your ContentProvider may well be used by your app otherwise, shutdown() or not.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top