# 主屏activity内:
privateSecondDisplay secondDisplay;privatevoiddualScreen3288(){DisplayManager displayManager =(DisplayManager)getApplicationContext().getSystemService(DISPLAY_SERVICE);if(displayManager !=null){Display[] presentationDisplays = displayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION);//检测到主屏外显示屏数if(presentationDisplays.length >0){// If there is more than one suitable presentation display, then we could consider giving the user a choice. For this example, we simply choose the first display which is the one the system recommends as the preferred presentation display.//多个附加屏时可自由选择,这里选第一个secondDisplay =newSecondDisplay(this, presentationDisplays[0]);try{secondDisplay.show();}catch(Throwable e){e.printStackTrace();}}else{logError("showDualScreen: 未找到副屏!");}}}//关闭副屏privatevoidcloseSecondScreen(){if(secondDisplay !=null){secondDisplay.release();secondDisplay.dismiss();secondDisplay =null;}}
故障现象:
忘记了Vscode的这个密码: Enter password to unlock An application wants access to the keyring “Default ke... Password: The unlock password was incorrect Cancel Unlock 解决办法:
1.任意terminal下,输入如下…