我刚刚在我的按钮上添加了 +1 google,但它在 initialize() 之后总是灰色的,并且无法对此做任何事情:
我的代码如下所示:
public class Stars extends Activity implements ConnectionCallbacks,
OnConnectionFailedListener {
private PlusClient mPlusClient;
PlusOneButton mPlusOneButton;
private static final int PLUS_ONE_REQUEST_CODE = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.stars);
// g+1------------------------------------------------------
mPlusClient = new PlusClient.Builder(this, this, this)
.setVisibleActivities(
"http://schemas.google.com/AddActivity",
"http://schemas.google.com/BuyActivity").build();
mPlusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button);
// ---------------------------------------------------------
}
@Override
protected void onStart() {
super.onStart();
mPlusClient.connect();
}
@Override
protected void onStop() {
super.onStop();
mPlusClient.disconnect();
}
@Override
protected void onResume() {
mPlusOneButton.initialize(mPlusClient,
"https://developers.google.com/+", PLUS_ONE_REQUEST_CODE);
super.onResume();
}
public void onConnectionFailed(ConnectionResult status) {
// Nothing to do.
}
public void onDisconnected() {
// Nothing to do.
}
public void onConnected(Bundle arg0) {
// TODO Auto-generated method stub
}
}
如何修复它,我的代码中关于我在 google api 控制台中注册的信息在哪里?