Delete temporary images when app is closed - Android -


in application create new image files images picked gallery. these new image files compressed versions of counterparts in gallery.

when click submit button these files sent server. after confirmation of response server these temporary files deleted.

my question if close app once have selected images , before online submission, temporary (compressed) files stay in memory.

what best approach have cleanup method executes , removes temporary image files if any, when app closed. overriding ondestroy() right approach?

use these 2 method :  

onsaveinstancestate() , ondestroy() . write clear memory code in method . if app in background , close onsaveinstance called , direct close app ondestroy called.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -