How to restart the android system
1. The first Restart Method
Public class RebootActivity extends Activity {
/** Called when the activity is first created .*/
@ Override
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. main );
}
Public void click (View view ){
Intent intent = new Intent ();
Intent. setAction (Intent. ACTION_REBOOT );
Intent. putExtra ("nowait", 1 );
Intent. putExtra ("interval", 1 );
Intent. putExtra ("window", 0 );
SendBroadcast (intent );
}
}
Add android: sharedUserId = "android. uid. system" to the configuration file"
2. method 2
Public class Reboot2Activity extends Activity {
/** Called when the activity is first created .*/
@ Override
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. main );
}
Public void click (View view ){
While (true ){
Toast toast = new Toast (this );
Toast. setView (new View (this ));
Toast. show ();
}
}
}