createMediaFile is just a helper method, so it shouldn't do any multithreading. Instead, you should put the async logic into the caller. This is done already except for in onActivityResult().