如何通知Android中更改的系统设置

时间:2016-12-13 01:48:14

标签: android android-windowmanager android-settings

我开发了一个应用程序(推送到/ system / app)并希望修改一些系统设置,我喜欢

 public void changeAnimationSettings(boolean isChecked) {

        int result1 = isChecked ? 0 : 1;
        Settings.Global.putInt(getContentResolver(), Settings.Global.ANIMATOR_DURATION_SCALE, result1);
        Settings.Global.putInt(getContentResolver(), Settings.Global.WINDOW_ANIMATION_SCALE, result1);
        Settings.Global.putInt(getContentResolver(), Settings.Global.TRANSITION_ANIMATION_SCALE, result1);


        Log.i(TAG, "---->>ANIMATOR_DURATION_SCALE: " + Settings.Global.getString(getContentResolver(), Settings.Global.ANIMATOR_DURATION_SCALE));
        Log.i(TAG, "---->>WINDOW_ANIMATION_SCALE: " + Settings.Global.getString(getContentResolver(), Settings.Global.WINDOW_ANIMATION_SCALE));
        Log.i(TAG, "---->>TRANSITION_ANIMATION_SCALE " + Settings.Global.getString(getContentResolver(), Settings.Global.TRANSITION_ANIMATION_SCALE));

    }

日志显示值已成功更改,但是 问题是修改将无法立即工作,直到我再次打开系统设置应用程序。 我想价值变化不会在我的应用程序中通知系统。

0 个答案:

没有答案