Android Question Whren to close an audit file

FFMan

Member
Licensed User
Longtime User
I'm logging what a user does in a file on the sdcard.

To ensure the buffers are flushed and the file closed properly, when should I close the file ? especially relevant if I want the user to remove the card and hand it to someone.

I can use activity.finish but I know this is not recommended.

should I close the file on acitivy.pause and reopen it on resume ?
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
I can use activity.finish but I know this is not recommended.
Activity.Finish is absolutely not dangerous (still you understand activity's life cycle). You can use it when you need it. But ExitApplication is not recommended.

should I close the file on acitivy.pause and reopen it on resume ?
That's the way to go if you don't log other information in the background
 
Upvote 0
Top