Java Code Examples for android.provider.Settings#ACTION_SYNC_SETTINGS

The following examples show how to use android.provider.Settings#ACTION_SYNC_SETTINGS . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void openSyncSettingsPage(Activity activity) {
    // TODO(crbug/557784): This needs to actually take the user to a specific account settings
    // page. There doesn't seem to be an obvious way to do that at the moment, but should update
    // this when we figure that out.
    Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
    intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[] {"com.google"});
    activity.startActivity(intent);
}
 
Example 2
Source Project: island   File: IslandSetup.java    License: Apache License 2.0 5 votes vote down vote up
private static void showPromptForProfileManualRemoval(final Activity activity) {
	final AlertDialog.Builder dialog = new AlertDialog.Builder(activity).setMessage(R.string.dialog_cannot_destroy_message)
			.setNegativeButton(android.R.string.ok, null);
	final Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
	if (intent.resolveActivity(activity.getPackageManager()) == null) intent.setAction(Settings.ACTION_SETTINGS);	// Fallback to entrance of Settings
	if (intent.resolveActivity(activity.getPackageManager()) != null)
		dialog.setPositiveButton(R.string.open_settings, (d, w) -> activity.startActivity(intent));
	dialog.show();
	Analytics.$().event("cannot_destroy").send();
}
 
Example 3
public void requestToRemoveAccounts()
{
    Toast.makeText(MainActivity.mainActivity, "Please remove all accounts before going back", Toast.LENGTH_LONG).show();
    Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
    MainActivity.mainActivity.startActivityForResult(intent, MainActivity.REQUEST_FIRST_SETUP_ADMINISTRATOR_PRIVILEGES);
}