伙计们,感谢@dd619他的概念,我终于找到了这个问题的答案
我使用的概念是首先我需要解锁屏幕然后更新显示并再次锁定屏幕。
这是我对这个应用程序的最终编码
{
Context context= getApplicationContext();
KeyguardManager _guard = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
KeyguardLock _keyguardLock = _guard.newKeyguardLock("KeyguardLockWrapper");
//to disable
_keyguardLock.disableKeyguard();
String message ="New alarm :"+ alarmnew.size()+"\n old alarm :"+alarmold.size();
Settings.System.putString(this.getContentResolver(),
Settings.System.NEXT_ALARM_FORMATTED, message);
//to enable
_keyguardLock.reenableKeyguard();
}