sharing - Apps crashed when sending an image android ShareCompat and FileProvider -
the relevant apps appear on screen share when select 1 of them, selected app crashes. whatsapp says "file format not supported".
file imagefile = new file(imagepath); // image path mediastore uri contenturi = fileprovider.geturiforfile( this, "my.app.fileprovider", imagefile); intent shareintent = sharecompat.intentbuilder.from(this) .settype(getcontentresolver().gettype(contenturi)) .setstream(contenturi) .getintent(); shareintent.setdata(contenturi); shareintent.setflags( intent.flag_grant_read_uri_permission); if (shareintent.resolveactivity(getpackagemanager()) != null) { startactivity(intent.createchooser(shareintent, "select app")); }
Comments
Post a Comment