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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -