赞
踩
((AlarmManager)getSystemService(Context.ALARM_SERVICE)).setTimeZone("GMT+08:00");
使用GMT可以直接设置时区,但是时间没有修改,而使用GMT+8:00则直接报not an Olson ID的错,报错原因在方法中有说明:
因此替换为:
((AlarmManager)getSystemService(Context.ALARM_SERVICE)).setTimeZone("Asia/Shanghai");
就可以设置时区了,时间也会相应同步的。
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。