FLIR One Developer / Blog / Topics / android / Frame.save() failing if new activity started immediately after

Frame.save() failing if new activity started immediately after

Home Forums Android development Frame.save() failing if new activity started immediately after

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Ivan Ivan 2 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)

  • Author

    Posts

  • #5043

    Profile photo of Ivan
    Ivan

    Participant

    Guys. I’m experiencing issues where calling Frame.save fails if I start a new Activity immediately after calling the method. It works ok (most times but not always) on the first start of the Activity but if I do Activity A: saveFrame() -> Activity B: do something -> return to Activity A: then frame.save() will fail. I can still see “Writing image to /storage/emulated/0/folder/filename.jpg” printed in the logcat but the file does not end up being written until Activity B has finished. By which time it’s of no use.
    If it’s any help it appears that the issue is more pronounced in lower end devices but that’s purely anecdotal.

    #5045

    Profile photo of Tim Liew
    Tim Liew

    Moderator

    Hi Ivan,

    Are you loading the frame very soon after or right after in activity B? There are some race conditions when it comes to saving and loading frames.

    Best,
    Tim

    #5046

    Profile photo of Ivan
    Ivan

    Participant

    Hi Tim

    I’m not actually loading the frame itself in Activity B just a screenshot of Activity A. After a period of time (seconds) the user has the option to save a copy of the Frame source file.

    I’ve put a workaround in place to do a post delay after a second before starting Activity B. testing so far has been successful in all cases but it’s far from an ideal situation.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.