How to change the Lock screen custom text(Owner Info)?

对着背影说爱祢 提交于 2020-02-21 04:05:38

问题


I wrote the program code

String message = "This is test";
            Settings.System.putString(context.getContentResolver(),
                    Settings.Secure.LOCK_PATTERN_ENABLED, message);

This is not changing the lock screen text(Owner Info) and Added permission as

<uses-permission android:name="android.permission.WRITE_SETTINGS" />

回答1:


Change Settings.Secure.LOCK_PATTERN_ENABLED to Settings.System.NEXT_ALARM_FORMATTED.

Note that Settings.System.NEXT_ALARM_FORMATTED was deprecated in API level 21. You must use getNextAlarmClock() instead. getNextAlarmClock() is a public method in AlarmManager class which was introduced in API level 21. You need to install API level 21 in order to use this method. Also, make necessary changes in Android Project Build Target.



来源:https://stackoverflow.com/questions/27739066/how-to-change-the-lock-screen-custom-textowner-info

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!