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 <wangjiangfeng0...@gmail.com>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 <mc6...@mclink.it> 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! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---