gpt4 book ai didi

android - 加上一键分享选项使一个空帖子

转载 作者:可可西里 更新时间:2023-11-01 18:48:23 25 4
gpt4 key购买 nike

我已经按照这些非常简单的说明在我的应用程序上实现了 +1 按钮 https://developers.google.com/+/mobile/android/recommend .我将我的应用程序 url 作为 url 传递,将 0 作为 PLUS_ONE_REQUEST_CODE 传递。我认为 +1 部分有效,但我不确定,但分享部分很奇怪。基本上它会共享我键入的任何内容,如果我不键入任何内容但它不会共享 URL。好像有点没用!还有其他人有这个问题吗?

谢谢。

编辑:代码

创建时:

 plusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button);

关于简历:

plusOneButton.initialize(myapplink, 0);

按钮:

<com.google.android.gms.plus.PlusOneButton xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus"
android:id="@+id/plus_one_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

plus:size="standard"
plus:annotation="inline" />

编辑:我还应该指出,我在另一个应用程序(不是我的应用程序)上使用相同的按钮尝试过这个并且它有同样的问题。所以也许这是默认行为,但它似乎是无用的行为。

最佳答案

使用构建器进行共享。

@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.share_button:
PlusShare.Builder builder = new PlusShare.Builder(this);

// Set call-to-action metadata.
builder.addCallToAction(
"CREATE_ITEM", /** call-to-action button label */
Uri.parse("http://plus.google.com/pages/create"), /** call-to-action url (for desktop use) */
"/pages/create" /** call to action deep-link ID (for mobile use), 512 characters or fewer */);

// Set the content url (for desktop use).
builder.setContentUrl(Uri.parse("https://plus.google.com/pages/"));

// Set the target deep-link ID (for mobile use).
builder.setContentDeepLinkId("/pages/",
null, null, null);

// Set the share text.
builder.setText("Create your Google+ Page too!");

startActivityForResult(builder.getIntent(), 0);
break;
}
}

关于android - 加上一键分享选项使一个空帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29522688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com