Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安装按钮未显示在Google+;帐目_Android_Android Layout - Fatal编程技术网

Android 安装按钮未显示在Google+;帐目

Android 安装按钮未显示在Google+;帐目,android,android-layout,Android,Android Layout,我正在我的android应用程序中集成Google+1 api,用于+1推荐和共享。当我使用android手机共享我的应用程序时,安装按钮不会显示在Google+帐户中。用户可以直接下载到哪里。但当我使用web浏览器共享时,它会显示安装按钮 请建议我如何可以显示直接安装按钮时,用户共享我的应用程序 使用Android的Google+平台,您现在可以在Android应用程序中集成一个原生的+1按钮 1) 首先需要在活动中创建PlusClient对象 2) 在布局中包括PlusOneButton:

我正在我的android应用程序中集成Google+1 api,用于+1推荐和共享。当我使用android手机共享我的应用程序时,安装按钮不会显示在Google+帐户中。用户可以直接下载到哪里。但当我使用web浏览器共享时,它会显示安装按钮


请建议我如何可以显示直接安装按钮时,用户共享我的应用程序

使用Android的Google+平台,您现在可以在Android应用程序中集成一个原生的+1按钮

1) 首先需要在活动中创建PlusClient对象

2) 在布局中包括PlusOneButton:

<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" />
4) 每次活动在activity.onResume处理程序中接收焦点时,刷新PlusOneButton的状态

    @Override
    protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     mPlusClient = new PlusClient(this, this, this, Scopes.PLUS_PROFILE);
     mPlusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button);
    }
 protected void onResume() {
   super.onResume();
  // Refresh the state of the +1 button each time the activity receives focus.
   mPlusOneButton.initialize(mPlusClient, URL);
  }
有关详细信息,请参阅

一旦您在Google+按钮上获得clickEvent设置,它的可见性-->将消失,并将安装按钮的可见性-->设置为可见

希望这会有帮助