于 2010年12月13日 15:44, Dianne Hackborn 写道: > On Sun, Dec 12, 2010 at 11:27 PM, tangke <[email protected] > <mailto:[email protected]>> wrote: > > I have a question that how to get a service? > I have two different method to set backlightbrightness > 1. > IPowerManager pm = > > IPowerManager.Stub.asInterface(ServiceManager.getService(Context.POWER_SERVICE)); > pm.setBacklightBrightness(0); > > > This is using private implementation details of the platform. An > application using this is likely to break in the future. Heck, you > can't even write this code without bypassing the standard SDK tools and > building directly against the platform code. > thanks. I know. > > 2. > PowerManager mpm = > (PowerManager)mContext.getSystemService(Context.POWEER_SERVICE); > mpm.setBacklightBrightness(0); > > > This is the supported SDK API. > > -- > Dianne Hackborn > Android framework engineer > [email protected] <mailto:[email protected]> > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see > and answer them. > > -- > 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
-- 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

