在activity中 getWindow();addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 或在view中View.setKeepScreenOn(boolean)