Answer the question
In order to leave comments, you need to log in
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);
Answer the question
In order to leave comments, you need to log in
Incredibly, VKontakte technical support suggested the right solution:
you need to replace the mime type with another one, not image
, not video
and 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 questionAsk a Question
731 491 924 answers to any question