當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。