当前位置: 首页>>代码示例>>Java>>正文


Java PlusClient类代码示例

本文整理汇总了Java中com.google.android.gms.plus.PlusClient的典型用法代码示例。如果您正苦于以下问题:Java PlusClient类的具体用法?Java PlusClient怎么用?Java PlusClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PlusClient类属于com.google.android.gms.plus包,在下文中一共展示了PlusClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: revokeAccess

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
/**
 * Revoke Google+ authorization completely.
 */
public void revokeAccess() {

    if (mPlusClient.isConnected()) {
        // Clear the default account as in the Sign Out.
        mPlusClient.clearDefaultAccount();

        // Revoke access to this entire application. This will call back to
        // onAccessRevoked when it is complete, as it needs to reach the Google
        // authentication servers to revoke all tokens.
        mPlusClient.revokeAccessAndDisconnect(new PlusClient.OnAccessRevokedListener() {
            public void onAccessRevoked(ConnectionResult result) {
                updateConnectButtonState();
                onPlusClientRevokeAccess();
            }
        });
    }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PlusBaseActivity.java

示例2: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final String chosenAccountName = AccountUtils.getActiveAccountName(getActivity());
    mPlusClient = new PlusClient.Builder(getActivity(), this, this)
            .clearScopes()
            .setAccountName(chosenAccountName)
            .build();

    final Intent intent = BaseActivity.fragmentArgumentsToIntent(getArguments());
    mSessionUri = intent.getData();

    if (mSessionUri == null) {
        return;
    }

    mSessionId = ScheduleContract.Sessions.getSessionId(mSessionUri);

    mVariableHeightHeader = intent.getBooleanExtra(EXTRA_VARIABLE_HEIGHT_HEADER, false);

    LoaderManager manager = getLoaderManager();
    manager.restartLoader(0, null, this);

    setHasOptionsMenu(true);
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:26,代码来源:SessionFeedbackFragment.java

示例3: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
/**
 * Creates a {@link PlusClient} and kicks-off the connection flow.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Retain instance to avoid reconnecting on rotate.  This means that onDestroy and onCreate
    // will not be called on configuration changes.
    setRetainInstance(true);
    mHandler = new PlusClientFragmentHandler();

    // Create the PlusClient.
    PlusClient.Builder plusClientBuilder =
            new PlusClient.Builder(getActivity().getApplicationContext(), this, this);
    String[] visibleActivities = getArguments().getStringArray(ARG_VISIBLE_ACTIVITIES);
    if (visibleActivities != null && visibleActivities.length > 0) {
        plusClientBuilder.setVisibleActivities(visibleActivities);
    }
    mPlusClient = plusClientBuilder.build();

    if (savedInstanceState == null) {
        mRequestCode = INVALID_REQUEST_CODE;
    } else {
        mRequestCode = savedInstanceState.getInt(STATE_REQUEST_CODE, INVALID_REQUEST_CODE);
    }
}
 
开发者ID:thoinv,项目名称:kaorisan,代码行数:27,代码来源:PlusClientFragment.java

示例4: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sign_in_activity);

    mPlusClient = new PlusClient.Builder(this, this, this)
            .setActions(MomentUtil.ACTIONS)
            .build();

    mSignInStatus = (TextView) findViewById(R.id.sign_in_status);
    mSignInButton = (SignInButton) findViewById(R.id.sign_in_button);
    mSignInButton.setOnClickListener(this);
    mSignOutButton = findViewById(R.id.sign_out_button);
    mSignOutButton.setOnClickListener(this);
    mRevokeAccessButton = findViewById(R.id.revoke_access_button);
    mRevokeAccessButton.setOnClickListener(this);
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:18,代码来源:SignInActivity.java

示例5: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);

	plusClient = new PlusClient.Builder(this, this, this);
	plusClient.setScopes(Scopes.PLUS_LOGIN);
	plusClient.setVisibleActivities(
			"http://schemas.google.com/AddActivity",
			"http://schemas.google.com/BuyActivity");
	client = plusClient.build();

	findViewById(R.id.button_sign_in).setOnClickListener(this);
	dialog = new ProgressDialog(this);

		getIntent().getAction();
}
 
开发者ID:leomindez,项目名称:Google-Sign-In-Android,代码行数:18,代码来源:MainActivity.java

示例6: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_login);
	
	mLogout = getIntent().getBooleanExtra("logout", false);
	
	mPlusClient = new PlusClient.Builder(
			this, // Context 
			this, // ConnectionCallbacks
			this) // OnConnectionFailedListener
			.build();
	
	mProgress = (ProgressBar)findViewById(R.id.progressBar);
	mBtnSignIn = (SignInButton)findViewById(R.id.sign_in_button);
	mBtnSignIn.setOnClickListener(this);
	
	connectGPlus();
}
 
开发者ID:DesenvolvedoresGoogle,项目名称:Allow,代码行数:20,代码来源:LoginActivity.java

示例7: onSignedIn

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
public void onSignedIn(PlusClient plusClient) {
    mSignInStatus.setText(getString(R.string.signed_in_status));

    // We can now obtain the signed-in user's profile information.
    Person currentPerson = plusClient.getCurrentPerson();
    if (currentPerson != null) {
        String greeting = getString(R.string.greeting_status, currentPerson.getDisplayName());
        mSignInStatus.setText(greeting);
        // Add the user name in the Preferences
        AppPrefs.setUserAccountName(SignInActivity.this, currentPerson.getDisplayName());
        Intent reservationsIntent = new Intent(SignInActivity.this, NavDrawerMainActivity.class);
        startActivity(reservationsIntent);
        finish();
    } else {
        resetAccountState();
    }
}
 
开发者ID:someshk,项目名称:samsung-chord-hackathon,代码行数:19,代码来源:SignInActivity.java

示例8: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.person_list_activity);

    mPlusClient = new PlusClient.Builder(this, this, this)
            .setActions(MomentUtil.ACTIONS)
            .build();

    mListItems = new ArrayList<String>();
    mListAdapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, mListItems);
    mPersonListView = (ListView) findViewById(R.id.person_list);
    mResolvingError = savedInstanceState != null
            && savedInstanceState.getBoolean(STATE_RESOLVING_ERROR, false);

    int available = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    if (available != ConnectionResult.SUCCESS) {
        showDialog(DIALOG_GET_GOOGLE_PLAY_SERVICES);
    }
}
 
开发者ID:laurion,项目名称:wabbit-client,代码行数:22,代码来源:ListPeopleActivity.java

示例9: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.list_moments_activity);
    mPlusClient = new PlusClient.Builder(this, this, this)
            .setActions(MomentUtil.ACTIONS)
            .build();

    mListItems = new ArrayList<Moment>();
    mMomentListAdapter = new MomentListAdapter(this, android.R.layout.simple_list_item_1,
            mListItems);
    mMomentListView = (ListView) findViewById(R.id.moment_list);
    mMomentListView.setOnItemClickListener(this);
    mResolvingError = savedInstanceState != null
            && savedInstanceState.getBoolean(STATE_RESOLVING_ERROR, false);

    int available = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    if (available != ConnectionResult.SUCCESS) {
        showDialog(DIALOG_GET_GOOGLE_PLAY_SERVICES);
    }
}
 
开发者ID:laurion,项目名称:wabbit-client,代码行数:22,代码来源:ListMomentsActivity.java

示例10: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.share_activity);

    mPlusClient = new PlusClient.Builder(this, this, this)
            .setActions(MomentUtil.ACTIONS)
            .build();

    Button sendButton = (Button) findViewById(R.id.send_interactive_button);
    sendButton.setOnClickListener(this);

    mEditSendText = (EditText) findViewById(R.id.share_prefill_edit);
    mSharing = savedInstanceState != null
            && savedInstanceState.getBoolean(STATE_SHARING, false);

    int available = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    if (available != ConnectionResult.SUCCESS) {
        showDialog(DIALOG_GET_GOOGLE_PLAY_SERVICES);
    }
}
 
开发者ID:laurion,项目名称:wabbit-client,代码行数:22,代码来源:ShareActivity.java

示例11: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.multi_moment_activity);
    mPlusClient = new PlusClient.Builder(this, this, this)
            .setActions(MomentUtil.ACTIONS)
            .build();

    mListAdapter = new ArrayAdapter<String>(
            this, android.R.layout.simple_list_item_1, MomentUtil.MOMENT_LIST);
    mMomentListView = (ListView) findViewById(R.id.moment_list);
    mMomentListView.setOnItemClickListener(this);
    mResolvingError = savedInstanceState != null
            && savedInstanceState.getBoolean(STATE_RESOLVING_ERROR, false);

    int available = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    if (available != ConnectionResult.SUCCESS) {
        showDialog(DIALOG_GET_GOOGLE_PLAY_SERVICES);
    }
}
 
开发者ID:laurion,项目名称:wabbit-client,代码行数:21,代码来源:MomentActivity.java

示例12: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	mPlusClient = new PlusClient.Builder(this, this, this)
			.setVisibleActivities("http://schemas.google.com/AddActivity",
					"http://schemas.google.com/BuyActivity").build();
	mConnectionProgressDialog = new ProgressDialog(this);
	mConnectionProgressDialog.setMessage("Signin in...");
	setContentView(R.layout.activity_main);
	findViewById(R.id.sign_in_button).setOnClickListener(this);
	deepShare = (Button) findViewById(R.id.deeplink);
	deepShare.setOnClickListener(this);
	shareButton = (Button) findViewById(R.id.simpleshare_button);
	shareButton.setOnClickListener(this);

}
 
开发者ID:nRike,项目名称:GooglePlusBoilerplate,代码行数:17,代码来源:MainActivity.java

示例13: onActivityCreated

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onActivityCreated(savedInstanceState);

	getSherlockActivity().getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);

	mPlusClient = new PlusClient.Builder(this.getActivity().getApplicationContext(), this, this)
               .setActions("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity")
			.setScopes(Scopes.PLUS_LOGIN, Scopes.PLUS_PROFILE).build();

	mConnectionProgressDialog = new ProgressDialog(this.getActivity());
	mConnectionProgressDialog.setTitle("Login");
	// mConnectionProgressDialog.setCancelable(false);
	mConnectionProgressDialog.setMessage(getSherlockActivity().getString(R.string.google_login_));
}
 
开发者ID:JCERTIFLab,项目名称:jcertif-android-2013,代码行数:17,代码来源:LoginFragment.java

示例14: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final String chosenAccountName = AccountUtils.getChosenAccountName(getActivity());
    mPlusClient = new PlusClient.Builder(getActivity(), this, this)
            .clearScopes()
            .setAccountName(chosenAccountName)
            .build();

    final Intent intent = BaseActivity.fragmentArgumentsToIntent(getArguments());
    mSessionUri = intent.getData();

    if (mSessionUri == null) {
        return;
    }

    mSessionId = ScheduleContract.Sessions.getSessionId(mSessionUri);

    mVariableHeightHeader = intent.getBooleanExtra(EXTRA_VARIABLE_HEIGHT_HEADER, false);

    LoaderManager manager = getLoaderManager();
    manager.restartLoader(0, null, this);

    setHasOptionsMenu(true);
}
 
开发者ID:TheDeltaProgram,项目名称:iosched2013,代码行数:26,代码来源:SessionFeedbackFragment.java

示例15: onCreate

import com.google.android.gms.plus.PlusClient; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initialize the PlusClient connection.
    // Scopes indicate the information about the user your application will be able to access.
    mPlusClient =
            new PlusClient.Builder(this, this, this).setScopes(Scopes.PLUS_LOGIN,
                    Scopes.PLUS_PROFILE).build();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PlusBaseActivity.java


注:本文中的com.google.android.gms.plus.PlusClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。