使用我的Andr​​oid应用程序发送的文本标签到Instagram的 [英] Send Text Tag to Instagram using my Android app

查看:127
本文介绍了使用我的Andr​​oid应用程序发送的文本标签到Instagram的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序拍照并传送到Instagram的,Facebook和Twitter,但我需要的图片在Instagram的分享文本#myappname。

My app take pictures and send to instagram, facebook and twitter but I need to share the text "#myappname" with the picture in instagram.

这里的code我用它来发送照片

Here's the code I use to send the photos

Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/*");
caminhoImagens = getRealPathFromURI(Uri.parse(url));
Log.i("Caminho imagem: ", caminhoImagens);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + caminhoImagens));
shareIntent.setPackage("com.instagram.android");
startActivity(shareIntent);

我试图用codeS下面一起发送短信,但没有奏效。

I tried to use the codes below to send a text together but didn't work.

shareIntent.putExtra(Intent.EXTRA_TEXT,"#TEXT");
shareIntent.putExtra(Intent.EXTRA_TITLE,"#TEXT");
shareIntent.putExtra(Intent.EXTRA_SUBJECT,"#TEXT");

有人知道,如果有一种方法可以做到这一点?

Someone know if there is a way to do that?

感谢和问候。

推荐答案

最后,Instagram的API支持文本应用程序使用意图从Android的未来。

Finally Instagram API supports text coming from Android apps using Intent.

下面是意图code到Instagram的分享图片和文字。

Here is the intent code to share image and text in Instagram.

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shareIntent.putExtra(Intent.EXTRA_STREAM,uri);
shareIntent.putExtra(Intent.EXTRA_TEXT,"YOUR TEXT TO SHARE IN INSTAGRAM");
shareIntent.setPackage("com.instagram.android");
return shareIntent;

下面是文档

这篇关于使用我的Andr​​oid应用程序发送的文本标签到Instagram的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆