有什么方法可以检查系统托盘是否已经存在?当我继续运行程序以创建系统托盘时,会出现多次出现,这意味着正在运行多个程序。所以,我需要检查系统托盘是否已经存在?
您可以尝试:
boolean trayExists = SystemTray.getSystemTray().getTrayIcons().length > 0;