I am trying to reboot Android by broadcasting Intent.ACTION_REBOOT
from my activity.
I believe that I have given it all the proper permissions to send such
a signal but when I launch the activity, nothing happens. I saw a
similar post about this back in May, but no responses.
Logcat:
ActivityManager I Starting activity: Intent
{ action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x102000
00 comp=
{com.android.settings.shutitdown/
com.android.settings.shutitdown.ShutdownActivity} }
ActivityManager I Start proc com.android.settings.shutitdown for
activity com.android.settings.shutitdown/.ShutdownActivity: pid=1397
uid=10
00 gids={}
ShutdownActivity D creating activity: for reboot
ShutdownActivity I rebooted
InputConnectionWrapper W showStatusIcon on inactive InputConnection
ActivityManager I Displayed activity
com.android.settings.shutitdown/.ShutdownActivity: 564 ms
Note that there is no denial to send the Intent, just silence. Here
is the activity code:
public class ShutdownActivity extends Activity {
private static final String LOG_TAG = "ShutdownActivity";
public void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.shutdown_main);
Log.d(LOG_TAG, "creating activity: for reboot");
Intent i = new Intent(Intent.ACTION_REBOOT);
i.setAction(Intent.ACTION_REBOOT);
sendBroadcast(i);
Log.i(LOG_TAG, "rebooted");
}
public void onPause() {
}
}
...and the manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.settings.shutitdown"
android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.REBOOT" />
<application android:label="shutitdown"
android:icon="@drawable/ic_launcher_settings">
<activity android:name=".ShutdownActivity"
android:label="Shutdown">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /
>
</intent-filter>
</activity>
</application>
</manifest>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---