Java Code Examples for android.provider.Settings#ACTION_SETTINGS

The following examples show how to use android.provider.Settings#ACTION_SETTINGS . 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
Source File: LegacyGlobalActions.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private Action getSettingsAction() {
    return new SinglePressAction(com.android.internal.R.drawable.ic_settings,
            R.string.global_action_settings) {

        @Override
        public void onPress() {
            Intent intent = new Intent(Settings.ACTION_SETTINGS);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
            mContext.startActivity(intent);
        }

        @Override
        public boolean showDuringKeyguard() {
            return true;
        }

        @Override
        public boolean showBeforeProvisioning() {
            return true;
        }
    };
}
 
Example 2
Source File: NetworkUtil.java    From TikTok with Apache License 2.0 6 votes vote down vote up
/**
     * 打开系统设置界面
     */
    public static void openSetting(Activity activity) {
//        Intent intent = new Intent("/");
//        ComponentName cm = new ComponentName("com.android.settings",
//                "com.android.settings.WirelessSettings");
//        intent.setComponent(cm);
//        intent.setAction("android.intent.action.VIEW");
//        activity.startActivityForResult(intent, 0);

        //打开移动网络设置界面
//        Intent intent =  new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
//        activity.startActivity(intent);

        Intent intent = new Intent(Settings.ACTION_SETTINGS);
        activity.startActivity(intent);

    }
 
Example 3
Source File: IntentUtils.java    From DevUtils with Apache License 2.0 5 votes vote down vote up
/**
 * 获取跳转到系统设置的意图
 * @param isNewTask 是否开启新的任务栈
 * @return 跳转到系统设置的意图
 */
public static Intent getSystemSettingIntent(final boolean isNewTask) {
    try {
        Intent intent = new Intent(Settings.ACTION_SETTINGS);
        return getIntent(intent, isNewTask);
    } catch (Exception e) {
        LogPrintUtils.eTag(TAG, e, "getSystemSettingIntent");
    }
    return null;
}
 
Example 4
Source File: NfcDataWriteActivity.java    From dhis2-android-capture-app with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
protected void onResume() {
    super.onResume();
    disposable = new CompositeDisposable();
    if (nfcManager.verifyNFC())
        init();
    else {
        Intent setnfc = new Intent(Settings.ACTION_SETTINGS);
        startActivity(setnfc);
    }


}
 
Example 5
Source File: SearchActivity.java    From HayaiLauncher with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle item selection
    switch (item.getItemId()) {
        case R.id.action_settings:
            final Intent intentSettings = new Intent(this, SettingsActivity.class);
            startActivity(intentSettings);
            return true;
        case R.id.action_refresh_app_list:
            recreate();
            return true;
        case R.id.action_system_settings:
            final Intent intentSystemSettings = new Intent(Settings.ACTION_SETTINGS);
            intentSystemSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intentSystemSettings);
            return true;
        case R.id.action_manage_apps:
            final Intent intentManageApps = new Intent(Settings.ACTION_APPLICATION_SETTINGS);
            intentManageApps.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intentManageApps);
            return true;
        case R.id.action_set_wallpaper:
            final Intent intentWallpaperPicker = new Intent(Intent.ACTION_SET_WALLPAPER);
            startActivity(intentWallpaperPicker);
            return true;
        case R.id.action_about:
            final Intent intentAbout = new Intent(this, AboutActivity.class);
            startActivity(intentAbout);
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
Example 6
Source File: IntentUtil.java    From BaseProject with MIT License 4 votes vote down vote up
/** 跳转到设置界面 */
public static void setting(@NonNull Context context) {
    Intent intent = new Intent(Settings.ACTION_SETTINGS);
    context.startActivity(intent);
}
 
Example 7
Source File: BaseUiHelper.java    From BaseProject with Apache License 2.0 4 votes vote down vote up
/**
 * 跳转到系统设置界面
 * @param context
 */
public static void jumpToSystemSetting(Context context) {
    Intent toSettingActionIntent = new Intent(Settings.ACTION_SETTINGS);
    jumpToActivity(context,toSettingActionIntent,0,false);
}
 
Example 8
Source File: Util.java    From mirror with MIT License 4 votes vote down vote up
/**
 * Launches the system's default settings activity.
 */
public void launchSettings() {
  Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);
  context.startActivity(settingsIntent);
}