I'm learning about android programming from official website(http://developer.android.com). I understand most of life cycle, but I'm not sure when system is destroying activity.
From what I understand, system is destroying activity when some activity stays for longer time in onStop()
or when foreground activity needs more resources. Is that right ?
And from what I read the most efficient way to update data base is in onStop()
, but let's say user is adding one word to my 'dictionary' application. So I need to gather this words in list and then update data base? Or I should insert rows to DB with each word ( in other method ) ?