在Google Plus中共享图片并链接在一起

时间:2015-09-09 11:13:11

标签: android google-plus sharing

在我的应用程序中,我必须分享标题,图像和链接。我的编码如下:

public void shareOnGooglePlus(Uri uri) {

    PlusShare.Builder shareBuilder = new PlusShare.Builder(this);
    shareBuilder.setType("text/plain");

    shareBuilder.setText("title");

    if (uri != null) {
        String mime = getContentResolver().getType(uri);                              
        shareBuilder.setContentUrl(Uri.parse("my_url_to_publish"));           
        shareBuilder.addStream(uri);
        shareBuilder.setType(mime);
    }
    Intent shareIntent = shareBuilder.getIntent();

    try {
        startActivityForResult(shareIntent, SHARE_GOOGLE_PLUS_REQUEST_CODE);
    } catch (ActivityNotFoundException ane) {
        ToastUtils.SHOW(this, getString(R.string.google_plus_not_installed));
    }
}

问题是它没有显示内容uri,如果我从中删除了流,那么它将显示链接。

我该如何解决这个问题?

0 个答案:

没有答案
相关问题