我有一些代码如何share image with instagram
。我的代码如下
但我想加上标题。
我添加了share text with image
的代码,但它不起作用。我想发送位图对象而不是带有函数参数的uri,我如何添加它。
请看下面的代码。
public void shareInstagram(Uri uri) // instead of uri i want to put bitmap object
{
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/*"); // set mime type
shareIntent.putExtra(Intent.EXTRA_STREAM,uri); // instead of uri i want ot add bitmap image
shareIntent.setPackage("com.instagram.android");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Sample subject");
//shareIntent.putExtra(Intent.EXTRA_TEXT, "Sample text");
//shareIntent.putExtra(Intent.EXTRA_TITLE, "Sample title");
startActivity(shareIntent);
}
请帮帮我..朋友
最佳答案
不建议将位图从一个意图传递到另一个意图。最好传递一个uri,然后毕加索将其放置在imageview中,如http://square.github.io/picasso/