Delete file after sharing via intent.

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2011-01-05T21:00:08Z Indexed on 2011/01/05 21:53 UTC
Read the original article Hit count: 193

Filed under:
|
|
|
|

I'm trying to delete a temporary file after sharing it via android's Intent.ACTION_SEND feature. Right now I am starting the activity for a result and in OnActivityResult, I am deleting the file. Unfortunately this only works if I am debugging it with a breakpoint, but when I let it run freely and say, email the file, the email has no attachment.

I think what is happening is my activity is deleting the file before it had been emailed. What I don't get is why, shouldn't onActivityResult only be called AFTER the other activity is finished?

I have also tried deleting the file in onResume, but no luck.

Is there a better way to do this?

© Stack Overflow or respective owner

Related posts about android

Related posts about email