S
S
SIDS2016-01-13 19:41:55
Android
SIDS, 2016-01-13 19:41:55

How to send a GIF file via Intent to the VKontakte application in Android?

When developing an application for Android, it became necessary to implement the functionality of sending a GIF file through VKontakte messages.
It seemed obvious to do this through Intent.ACTION_SEND, since the VKontakte application can handle it.

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/gif");
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("example.gif")));
intent.setPackage("com.vkontakte.android");
startActivity(intent);

But in a private message, it's not a gif image, but a jpef image.
Accordingly, how to do it through Intent?
It is possible to use the VK API and send a message with a gif image as an attachment, but this is much more difficult.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SIDS, 2016-01-19
@SIDS

Incredibly, VKontakte technical support suggested the right solution:
you need to replace the mime type with another one, not image, not videoand not audio. For example, on application/vnd.my.package.
Then the transmitted gif file is saved in the user's Documents and sent as a message

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question