选择时,SCREEN_OFF_TIMEOUT无效?

时间:2017-11-07 06:18:28

标签: android

当我调试应用程序会崩溃?我在下面添加了我的代码并使用Android 7.1请检查并帮助我?

    public void setTimeout(int screenOffTimeout) {
        int time;
        switch (screenOffTimeout) {
            case 0:
                time = 30000;
                break;
            case 1:
                time = 60000;
                break;
            case 2:
                time = 300000;
                break;
            case 3:
                time = 600000;
                break;
            case 4:
                time = 1800000;
                break;
            default:
                time = 30000;
        }
        Settings.System.getInt(getActivity().getContentResolver(),
                Settings.System.SCREEN_OFF_TIMEOUT,time);
    }

0 个答案:

没有答案