This is totally untested because of emulator failure, but it should work...

....