都是中国人,就不用什么鸟英语了,直接汉字。 Power 类在应用的时候,我不知道是否有权限的问题。也许正如上面Yuri所说,也许在Activity下使用有可能有权限限制。
因为我写的程序是没有activity的,而且拥有最高的权限,貌似部分系统进程都没他高,所以才能实现。 我是通过把代码放到源码中重新编译得到如此高权限的程序的。 On 7月22日, 下午4时26分, Stephen Le <[email protected]> wrote: > As you say, I tried to import this class into my Activity..But It is doesn't > work..Do you have any demo project to give me ? I've traped at this place > for a long times and need your kindly help...Sincerely! > > On Wed, Jul 22, 2009 at 3:53 PM, Sansiro <[email protected]>wrote: > > > > > > > > > Stephen > > I did not create Power class. The Power class is packaged in > > android.os.Power by Google > > But it's so strange that you can not find it in SDK documents > > > On 7月22日, 下午3时15分, Stephen Le <[email protected]> wrote: > > > Sansiro > > > I want to know , Did you created the Power class in your own project? or > > > other ways? Pls tell me... > > > > On Wed, Jul 22, 2009 at 1:55 PM, Sansiro <[email protected] > > >wrote: > > > > > emm,I'm Sorry to say that the result I just said before is not right. > > > > > By using the native method setScreenState(), I make my device's screen > > > > off.The code is: > > > > > int x=Power.setScreenState(false);//make the screen off > > > > System.out.println(x);//0 will be print out > > > > Thread.sleep(3000); > > > > x=Power.setScreenState(true);//make the screen on > > > > System.out.println(x);//0 will be print out > > > > > I tried this code on emulator, it works too. > > > > PS: I use the 1.1r1 SDK and emulator > > > > > On Jul 21, 9:17 pm, Yuri Dario <[email protected]> wrote: > > > > > Hi, > > > > > > > public static native int setScreenState(boolean on) > > > > > > tried this one, but calling it does nothing, and always returns 2; > > > > > since this is a native method, I think it means EACCESS (permission > > > > > denied). > > > > > > thanks, > > > > > > Yuri > > > > -- > > > Sincerely! > > -- > Sincerely! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

