Delete screenshot after intent has finished

This commit is contained in:
fkloft
2014-03-01 13:40:01 +01:00
parent b30c1e4aa3
commit bd6a98725f
2 changed files with 23 additions and 3 deletions

View File

@ -863,7 +863,12 @@ public class IITC_Mobile extends Activity
// quality is ignored by PNG
throw new IOException("Could not compress bitmap!");
}
startActivity(ShareActivity.forFile(this, file, "image/png"));
startActivityForResult(ShareActivity.forFile(this, file, "image/png"), new ResponseHandler() {
@Override
public void onActivityResult(final int resultCode, final Intent data) {
file.delete();
}
});
} catch (final IOException e) {
Log.e("Could not generate screenshot", e);
}