Android OS 2.2 Permissions: I have absolutely no idea why this simple piece of code doesn't work. What am I doing wrong?

后端 未结 3 1274
走了就别回头了
走了就别回头了 2020-12-06 19:57

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条回答
  • 2020-12-06 20:46

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

    Update

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

    0 讨论(0)
  • 2020-12-06 20:50

    insetad of System.out.println() use Log.v() or similar.

    I think I found your error, please try it out: Remove </uses-permission> on both lines, that should work

    0 讨论(0)
  • 2020-12-06 20:53

    using AlarmManager with SET_TIME permission to set system time seems to work :)

    0 讨论(0)
提交回复
热议问题