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


Java Settings.ACTION_ADD_ACCOUNT屬性代碼示例

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


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

示例1: onAddAccountClicked

public void onAddAccountClicked(View view) {
    Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[]{getString(R.string.account_type)});
    }
    startActivity(intent);
}
 
開發者ID:danvratil,項目名稱:FBEventSync,代碼行數:7,代碼來源:MainActivity.java

示例2: openAndroidAccountCreationScreen

/**
 * Opens the Android account manager for adding or creating a Google account.
 * @param applicationContext
 */
private static void openAndroidAccountCreationScreen(
        Context applicationContext) {
    logEvent(ProfileAccountManagementMetrics.DIRECT_ADD_ACCOUNT, GAIA_SERVICE_TYPE_SIGNUP);

    Intent createAccountIntent = new Intent(Settings.ACTION_ADD_ACCOUNT);
    createAccountIntent.putExtra(
            EXTRA_ACCOUNT_TYPES, new String[]{EXTRA_VALUE_GOOGLE_ACCOUNTS});
    createAccountIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
            | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK
            | Intent.FLAG_ACTIVITY_CLEAR_TOP);

    applicationContext.startActivity(createAccountIntent);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:17,代碼來源:AccountManagementScreenHelper.java

示例3: createAddGoogleAccountIntent

private static Intent createAddGoogleAccountIntent() {
    Intent createAccountIntent = new Intent(Settings.ACTION_ADD_ACCOUNT);
    // NOTE: the documentation says Settings.EXTRA_AUTHORITIES should be used,
    // but it doesn't work.
    createAccountIntent.putExtra(
            EXTRA_ACCOUNT_TYPES, new String[]{EXTRA_VALUE_GOOGLE_ACCOUNTS});
    return createAccountIntent;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:8,代碼來源:AccountAdder.java

示例4: promptAddAccount

private void promptAddAccount() {
    Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
    intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[]{"com.google"});
    startActivity(intent);
    finish();
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:6,代碼來源:BaseActivity.java

示例5: signInOrCreateAnAccount

private void signInOrCreateAnAccount() {
    //Get list of accounts on device.
    AccountManager am = AccountManager.get(BaseActivity.this);
    Account[] accountArray = am.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
    if (accountArray.length == 0) {
        //Send the user to the "Add Account" page.
        Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
        intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES,
                new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE});
        startActivity(intent);
    } else {
        //Try to log the user in with the first account on the device.
        startLoginProcess();
        mDrawerLayout.closeDrawer(GravityCompat.START);
    }
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:16,代碼來源:BaseActivity.java


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