I'm trying to share audio files from my android app with other applications including VK: https://play.google.com/store/apps/details?id=com.vkontakte.android&hl=en The sharing functionality works fine with different applications, but not with VK. The code looks like:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_STREAM, fileUri);
intent.setType(context.getContentResolver().getType(fileUri));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
context.startActivity(intent);
In VK app during uploading process I get just "Error" without any information. In logcat I get the following error:
W/vk: com.vkontakte.android.upload.UploadException: can't save photo
at com.vkontakte.android.upload.AudioUploadTask.c(AudioUploadTask.java:95)
at com.vkontakte.android.upload.UploadTask.T_(UploadTask.java:78)
at com.vkontakte.android.upload.UploaderIntentService.a(UploaderIntentService.java:68)
at com.vkontakte.android.upload.UploaderIntentService.onHandleIntent(UploaderIntentService.java:42)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.os.HandlerThread.run(HandlerThread.java:61)
I tried different mime types: "audio/*", "audio/mp3", "application/vnd.package.name", but no success.