Hi Mark

You are right ..but I am compiling the complete android source.

This method is present in  "Source/frameworks/base/core/java/com/
android/internal/app/ShutdownThread.java"

I have also added user permissions for System Alert Window.

regards
Abhishek

On Mar 8, 5:23 pm, Mark Murphy <[email protected]> wrote:
> On Thu, Mar 8, 2012 at 5:25 AM, Abhishek Sharma <[email protected]> wrote:
> > I want to shutdown android device from application on pressing key.
>
> This is not possible from an ordinary SDK application.
>
> > Code snippet:
> > public void poweroff()
> > {
> >   ShutdownThread.shutdown(context, true);
> > }
>
> There is no ShutdownThread in the Android SDK.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.5
> Available!

-- 
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

Reply via email to