For instance when using database connection, threading or IO streams (all what is required explicit closing/free up) is there some standard way of doing this? Perhaps by implementing some standard interface so Framework/class consumer would be able call this resources cleanup logic for my class?
For those who have some experiance with .NET Framework
analogue would be IDisposable
interface, so by implementing this interface I can put all resource-cleanup logic in Dispose()
method so class consumers would be able check whether an instance of a class implements IDisposable
interface and then call Dispose()
explicitly.
Is there something built in Android as well?