嗨,我正在构建一个 Android App。它在 DatePicker 和 TimePicker 中接受用户的输入,并设置设备时间或模块时间。
这是我正在使用的代码
int nHrTime;
int nMinTime;
int nYear;
int nMonth;
int nDay;
nHrTime = DeviceTimePickr.getCurrentHour();
nMinTime = DeviceTimePickr.getCurrentMinute();
nYear = DeviceDatePickr.getYear();
nMonth = DeviceDatePickr.getMonth();
nDay = DeviceDatePickr.getDayOfMonth();
dDeviceCalendar.set(nYear, nMonth,nDay,nHrTime, nMinTime);
在 manifest.xml 文件中,我也更改了权限。
清单文件的变化
<uses-permission android:name="android.permission.SET_TIME"
android:protectionLevel="signature|system"/>
为什么这不起作用?我正在使用安卓 4.22