本文整理汇总了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);
}
示例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;
}
示例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();
}
示例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);
}
}