Android 安装按钮未显示在Google+;帐目
我正在我的android应用程序中集成Google+1 api,用于+1推荐和共享。当我使用android手机共享我的应用程序时,安装按钮不会显示在Google+帐户中。用户可以直接下载到哪里。但当我使用web浏览器共享时,它会显示安装按钮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+平台,您现在可以在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设置,它的可见性-->将消失,并将安装按钮的可见性-->设置为可见
希望这会有帮助