當前位置: 首頁>>代碼示例>>Java>>正文


Java PlusClient.Builder方法代碼示例

本文整理匯總了Java中com.google.android.gms.plus.PlusClient.Builder方法的典型用法代碼示例。如果您正苦於以下問題:Java PlusClient.Builder方法的具體用法?Java PlusClient.Builder怎麽用?Java PlusClient.Builder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.plus.PlusClient的用法示例。


在下文中一共展示了PlusClient.Builder方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: 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

示例3: newInstance

import com.google.android.gms.plus.PlusClient; //導入方法依賴的package包/類
public static GooglePlusFragment newInstance(String user_name,
		PlusClient plusClient, PlusClient.Builder builder) {
	GooglePlusFragment fragment = new GooglePlusFragment();
	Bundle bundle = new Bundle();
	bundle.putString("username", user_name);
	fragment.setArguments(bundle);
	fragment.client = plusClient;
	fragment.plusClientBuilder = builder;
	return fragment;
}
 
開發者ID:leomindez,項目名稱:Google-Sign-In-Android,代碼行數:11,代碼來源:GooglePlusFragment.java

示例4: addPlusFragment

import com.google.android.gms.plus.PlusClient; //導入方法依賴的package包/類
private void addPlusFragment(String user, PlusClient client,PlusClient.Builder builder) {

		FragmentManager fragmentManager = getSupportFragmentManager();
		FragmentTransaction transaction = fragmentManager.beginTransaction();
		transaction.add(R.id.fragment_container,
				GooglePlusFragment.newInstance(user, client,builder));
		transaction.commit();

	}
 
開發者ID:leomindez,項目名稱:Google-Sign-In-Android,代碼行數:10,代碼來源:MainActivity.java

示例5: 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);
    String[] scopes = getArguments().getStringArray(ARG_SCOPES);
    
    plusClientBuilder.setScopes(scopes);
    
    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);
    }

    // Attempt to connect.
    mPlusClient.connect();
    mIsConnecting = true;
}
 
開發者ID:vicfryzel,項目名稱:gplus-photohunt-client-android,代碼行數:36,代碼來源:PlusClientFragment.java

示例6: onListItemClick

import com.google.android.gms.plus.PlusClient; //導入方法依賴的package包/類
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
    if (position == mAccountListAdapter.getCount() - 1) {
        Intent addAccountIntent = new Intent(Settings.ACTION_ADD_ACCOUNT);
        addAccountIntent.putExtra(Settings.EXTRA_AUTHORITIES,
                new String[]{ScheduleContract.CONTENT_AUTHORITY});
        startActivity(addAccountIntent);
        return;
    }

    AccountActivity activity = (AccountActivity) getActivity();
    ConnectivityManager cm = (ConnectivityManager)
            activity.getSystemService(CONNECTIVITY_SERVICE);
    NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
    if (activeNetwork == null || !activeNetwork.isConnected()) {
        Toast.makeText(activity, R.string.no_connection_cant_login,
                Toast.LENGTH_SHORT).show();
        return;
    }

    activity.mCancelAuth = false;
    activity.mChosenAccount = mAccountListAdapter.getItem(position);
    activity.getSupportFragmentManager().beginTransaction()
            .replace(R.id.root_container, new AuthProgressFragment(), "loading")
            .addToBackStack("choose_account")
            .commit();

    PlusClient.Builder builder = new PlusClient.Builder(activity, activity, activity);
    activity.mPlusClient = builder
            .setScopes(AccountUtils.AUTH_SCOPES)
            .setAccountName(activity.mChosenAccount.name).build();
    activity.mPlusClient.connect();
}
 
開發者ID:TheDeltaProgram,項目名稱:iosched2013,代碼行數:34,代碼來源:AccountActivity.java

示例7: onCreate

import com.google.android.gms.plus.PlusClient; //導入方法依賴的package包/類
@Override
public void onCreate() {
  application = (GameApplication) getApplication();

  builder = new PlusClient.Builder(getApplicationContext(), this, this);
  builder.setScopes(Scopes.PLUS_LOGIN, GriddlerScopes.USERINFO_EMAIL);
  builder.setAccountName(application.getSelectedAccountName());
  plus = builder.build();
}
 
開發者ID:GoogleCloudPlatform,項目名稱:solutions-griddler-sample-android-client,代碼行數:10,代碼來源:GooglePlusService.java


注:本文中的com.google.android.gms.plus.PlusClient.Builder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。