Code example for PowerManager

Methods: reboot

0
			@Override 
			public void onClick(View v) {
				PowerManager pwrMgr = (PowerManager) getSystemService(Context.POWER_SERVICE);
				Toast.makeText(Main.this, 
					"I'll try, but will most likely fail, to reboot", Toast.LENGTH_LONG).show();
				pwrMgr.reboot(null);
				Toast.makeText(Main.this, 
					"Even more unlikely: still running after reoot!", Toast.LENGTH_LONG).show();
			} 
		}); 
		Button b2 = (Button) findViewById(R.id.bootHackButton);
		b2.setOnClickListener(new OnClickListener() {
			@Override 
			public void onClick(View v) {
				Toast.makeText(Main.this, 
						"About to try rebooting by resource exhaustion", Toast.LENGTH_LONG).show();
				while (true) { 
					Toast.makeText(Main.this, 
						"Hacking ur device", Toast.LENGTH_LONG).show();
				}