Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6003685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:09:23+00:00 2026-05-23T01:09:23+00:00

Is there any way to restart/shutdown a phone directly from an application? For Example:

  • 0

Is there any way to restart/shutdown a phone directly from an application?

For Example:
I need to restart/shutdown my Phone when i meet some specific condition…

Citations to Developer Website:

Permission to Reboot?

http://developer.android.com/reference/android/Manifest.permission.html#REBOOT

Permission to Brick the device???

http://developer.android.com/reference/android/Manifest.permission.html#BRICK

Method to reboot???

http://developer.android.com/reference/android/os/PowerManager.html#reboot%28java.lang.String%29

Method to reboot and Wipe??

http://developer.android.com/reference/android/os/RecoverySystem.html#rebootWipeUserData%28android.content.Context%29

Reboot Method in MonkeyRunner/MonkeyDevice:

http://developer.android.com/guide/developing/tools/MonkeyDevice.html#reboot

There are options to brick a device but why not to power-down or restart?

I tried the following code but it throws an exception..

Manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.schogini.PowerOff"
      android:versionCode="1"
      android:versionName="1.0">


    <uses-permission android:name="android.permission.REBOOT" />
    <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
    <uses-permission android:name="android.permission.DEVICE_POWER" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".PowerOffActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>

Java Code:

package com.schogini.PowerOff;


import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.PowerManager;
import android.view.View;
import android.widget.Button;


public class PowerOffActivity extends Activity {

    PowerManager pm;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
        Button mBuyButton = (Button) findViewById(R.id.button1);

        mBuyButton.setOnClickListener(new View.OnClickListener() 
        {
            public void onClick(View v) 
            {
                pm.reboot("null");
            }
        });
    }
}

Exception thrown in LogCat:

06-10 17:58:29.001: WARN/dalvikvm(2064): threadid=3: thread exiting with uncaught exception (group=0x4001b160)
06-10 17:58:29.001: ERROR/AndroidRuntime(2064): Uncaught handler: thread main exiting due to uncaught exception
06-10 17:58:29.011: ERROR/AndroidRuntime(2064): java.lang.NoSuchMethodError: android.os.PowerManager.reboot
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at com.schogini.PowerOff.PowerOffActivity$1.onClick(PowerOffActivity.java:28)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.View.performClick(View.java:2364)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.View.onTouchEvent(View.java:4179)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.widget.TextView.onTouchEvent(TextView.java:6545)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.View.dispatchTouchEvent(View.java:3709)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.os.Looper.loop(Looper.java:123)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at android.app.ActivityThread.main(ActivityThread.java:4363)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at java.lang.reflect.Method.invokeNative(Native Method)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at java.lang.reflect.Method.invoke(Method.java:521)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
06-10 17:58:29.011: ERROR/AndroidRuntime(2064):     at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:09:24+00:00Added an answer on May 23, 2026 at 1:09 am

    Not a standard Android distribution, no. Suitably rooted phones often have access to su/reboot commands, but for an off-the-shelf, commercially available device, no: there is no way to do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to restart the Springboard programmatically, but prevent the iPhone from
is there any way to update simulator after application code is changed without restart
Is there any way to restart the CF server through the Application.cfc, when the
Is there any way to change the icon of an application after it is
Is there any way to get the effect of running python -u from within
is there any way to tell Apache that it should restart the session and
Is there any way to make a call from within an app without quitting
Is there any way to restart a program in Eclipse? (preferably 1-click) I really
Is there any way to change the BackColor of the border of a panel
Is there any way I can run class files (i.e. with main as the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.