Monday 15 July 2013

java - Video sharing via intent to Apps like Viber and Line throws to error -



java - Video sharing via intent to Apps like Viber and Line throws to error -

i want share video file in app via code:

intent share = new intent(intent.action_send); uri uri = uri.fromfile(path); share.putextra(intent.extra_stream, uri); share.settype("video/*"); context.startactivity(intent.createchooser(share, "share video using"));

it works , sharing window opens, apps viber , line error! viber says "the selected file unsupported or appears corrupted". illustration whatsapp can share video successfully.

it not related video format because same video can share gallery app of others apps viber, line and...

how can prepare this? there other add together intent apps viber can observe valuable info parse?

i had same problem , made work adding next prefix video string path: 'content://media' code should like:

intent share = new intent(intent.action_send); uri uri = uri.fromfile("content://media" + path); share.putextra(intent.extra_stream, uri); share.settype("video/*"); context.startactivity(intent.createchooser(share, "share video using"));

i hope can help out because did trick me.

java android android-intent

No comments:

Post a Comment