Screenshot.isPowerConnect = false;
//Toast.makeText(context, “DISCONNECTED”, Toast.LENGTH_SHORT).show();
new Thread(new shutdownThread()).start();
}
}
/**
-
Shutdown
-
@param context
*/
public void shutdown(Context context) {
try {
Intent intent = new Intent(
“android.intent.action.ACTION_REQUEST_SHUTDOWN”);
intent.putExtra(“android.intent.extra.KEY_CONFIRM”, false);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
} catch (Exception e) {
}
Toast.makeText(context, context.getResources().getString(R.string.shutdown_now), Toast.LENGTH_SHORT).show();
}
public class shutdownThread implements Runnable {
@Override
public void run() {
synchronized (shutdownHandler) {
while (!