Android操作系统2.2许可:我绝对不知道为什么这一段简单的code不起作用。我究竟做错了什么? [英] Android OS 2.2 Permissions: I have absolutely no idea why this simple piece of code doesn't work. What am I doing wrong?

查看:127
本文介绍了Android操作系统2.2许可:我绝对不知道为什么这一段简单的code不起作用。我究竟做错了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在摆弄一些code。我创建活动,简单地做这样的事情:

I'm just playing around with some code. I create an Activity and simply do something like this:

long lo = currentTimeMillis();
System.out.println(lo);

lo *= 3;
System.out.println(lo);

SystemClock.setCurrentTimeMillis(lo);
System.out.println( currentTimeMillis() );

是的,我在AndroidManifest.xml中,我已经添加了:

Yes, in my AndroidManifest.xml, I've added:

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

没有发生任何变化。该SystemClock从不重置...它只是不断滴答作响。 说我想起来的错误说,许可SET_TIME并没有给程序授予。保护等级3。

Nothing changes. The SystemClock is never reset...it just keeps on ticking. The error that I'm getting just says that the permission "SET_TIME" was not granted to the program. Protection level 3.

的权限是有......和2.2的API中它说,这个功能现在支持。我不知道我做错了。

The permissions are there...and in the API for 2.2 it says that this feature is supported now. I have no idea what I'm doing wrong.

如果android.content.Intent;进场时,请解释。我真的不明白背后的思想意图!

If android.content.Intent; comes into play, please explain. I don't really understand what the idea behind intents!

感谢您的帮助!

推荐答案

有一个SET_TIME_ZONE权限,但没有SET_TIME权限。应用程序不能以编程方式更改系统时钟。

There is a SET_TIME_ZONE permission but there's no SET_TIME permission. Applications cannot programmatically change the system clock.

更新

SET_TIME可自2.2,而只能被授予系统进程或应用程序与系统签名。

SET_TIME is available since 2.2, but can only be granted to the system process or apps signed with the system signature.

这篇关于Android操作系统2.2许可:我绝对不知道为什么这一段简单的code不起作用。我究竟做错了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆