Tag: popupwindow

如何在Android中的PopupWindow中创建Spinner小部件? 单击Spinner时获取BadTokenException

我一直在网上搜索这个问题的解决方案,但不幸的是,我似乎无法找到答案。 我为PopupWindow创建了一个XML文件,里面有一个Spinner。 在按钮事件监听器中,我调用以下代码来膨胀PopupWindow并在屏幕上显示它。 LayoutInflater inflater = getLayoutInflater(); settings_layout = inflater.inflate(R.layout.setting_popout, (ViewGroup) findViewById(R.id.setting_popout)); // Creates a popup window of required width and height, and displays // the popup in the center of the screen. pw_settings = new PopupWindow(settings_layout, 400, 470, true); pw_settings.showAtLocation(settings_layout, Gravity.CENTER, 0, 0); spColors = (Spinner) settings_layout.findViewById(R.id.linecolor); // Sets the initial values of the […]

selenium,我该如何选择新窗口

我在Eclipse中用TestNG运行我的selenium rc测试。 我有一个试图打开新浏览器页面的链接。 如何选择此新页面进行操作? 我用这个代码: selenium.selectWindow(“name=NewPage”); 但它说找不到页面。 我还尝试使用以下代码定义页面ID或标题: String[] wins = selenium.getAllWindowIds(); for (String s : wins) System.out.println(“win: ” + s); 它没有定义我新打开的窗口: win: MainPage win: 如果使用selenium.getAllWindowNames()我win: selenium_main_app_window win: selenium_blank65815 。 我写这段代码selenium.selectWindow(“name=blank99157”); 但得到错误 – ERROR: Window does not exist. If this looks like a Selenium bug, make sure to read http://seleniumhq.org/docs/02_selenium_ide.html#alerts-popups-and-multiple-windows for potential workarounds. ERROR: Window […]