popupwindow

PopupWindow $BadTokenException: Unable to add window ― token null is not valid

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have the following error when showing a PopupWindow. The errors are triggered by the line: checkInPopup . showAtLocation (( ViewGroup ) mapView . getParent (), Gravity . CENTER_HORIZONTAL , 0 , 0 ); mapView is a MapView and nothing is null. The stacktrace: 01 - 08 18 : 00 : 09.402 : E / AndroidRuntime ( 27768 ): Caused by : android . view . WindowManager$BadTokenException : Unable to add window -- token null is not valid ; is your activity running ? 01 - 08 18 : 00 : 09.402 : E / AndroidRuntime ( 27768 ): at android . view .

How to make a “popup” (hint, drop-down, popup) window in Winforms?

删除回忆录丶 提交于 2019-12-03 07:48:43
How can i make, what i will call, a "popup" window" in WinForms? Since i used my own made-up word "popup" , let me give examples of this so-called "popup" window: a tooltip window (can extend outside the boundaries of its parent form, doesn't appear in the taskbar, is not modal, and doesn't steal focus): a popup menu window (can extend outside the boundaries of its parent form, doesn't appear in the taskbar, is not modal, and doesn't steal focus): a drop-down window (can extend outside the boundaries of its parent form, doesn't appear in the taskbar, is not modal, and doesn't steal focus): A

FB.login inside FB.getLoginStatus popup window blocked

戏子无情 提交于 2019-12-03 07:46:11
I'm trying to integrate Facebook login into my website with Facebook Javascript SDK. According to the step by step instructions provided by Facebook Developer document here , here is the test code I wrote: <script> window.fbAsyncInit = function() { FB.init({ appId : '{$MY_APP_ID}', cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse social plugins on this page version : 'v2.1', // use version 2.1 status : true, // check FB login status }); }; function fblogin() { FB.getLoginStatus(function(response) { if (response.status === 'connected') { alert(

ListPopupWindow not obeying WRAP_CONTENT width spec

爷,独闯天下 提交于 2019-12-03 06:30:28
问题 I'm trying to use ListPopupWindow to show a list of strings via an ArrayAdapter (eventually this will be a more complex custom adapter). Code is below. As shown in the screenshot, the resulting ListPopupWindow seems to act as if the content width is zero. It shows the proper number of items, the items are still clickable, and clicking successfully produce a Toast , so at least that much is working properly. An interesting note: I could supply a width in pixels to popup.setWidth(...) instead

PopupView not showing up?

和自甴很熟 提交于 2019-12-03 06:17:06
Here's the XML (just a webview): <?xml version="1.0" encoding="utf-8"?> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/couponView" android:layout_height="100dp" android:layout_width="100dp" /> and the code: final View cView = getLayoutInflater().inflate(R.layout.couponlayout, null); PopupWindow pw = new PopupWindow(cView); pw.showAtLocation(findViewById(R.id.mainLayout), Gravity.CENTER, 100, 100); pw.update(); This is in a button.onClick() method. When I click the button, the rest of the things that should happen (button changes color, text, etc.), but the

How to refresh parent page after closing popup window in javascript?

我与影子孤独终老i 提交于 2019-12-03 04:58:13
I have one page list.jsp having list of all records in table and one button at top to add new record. I want to open add.jsp as a popup window. This works but when I close popup window how to update list.jsp so that it shows newly added record Here is my code what i tried... list.jsp <html> <head> <script> function popupwindow(url, title, w, h) { var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); popupWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='

Android开发中遇到的exception

非 Y 不嫁゛ 提交于 2019-12-03 03:42:05
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lam.fundamental/com.lam.datasave.dairy.DairyActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' 环境:在启动ListActivity的时候抛出 原因: android:id = "@+id/android:xxxList" 解决:把上面的改成: android:id = "@+id/android:list" android.content.ActivityNotFoundException: Unable to find explicit activity class {***************.DiaryEditActivity}; have you declared this activity in your AndroidManifest.xml? 环境:启动activity的时候抛出 原因: AndroidManifest.xml文件中未声明activity 解决:在 AndroidManifest

Android Nougat PopupWindow showAsDropDown(…) Gravity not working

巧了我就是萌 提交于 2019-12-03 03:15:35
I have this code. PopupWindow popUp = new PopupWindow(); popUp.setFocusable(true); popUp.setOutsideTouchable(true); popUp.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); popUp.setHeight(600); popUp.setContentView(anchorView); popUp.showAsDropDown(anchorView); popUp.update(); And its perfectly works on Android Version < Android Nougat. But in Android Nougat, the popup is being displayed at the top of the screen instead of relative to the anchor view. Liang Steve It seems a bug in android 7.0. But you can solve it with a compatible way. PopupWindow popUp = new PopupWindow(); popUp.setFocusable

Can a View on a PopupWindow display a PopupMenu?

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In Android API11+ I'm displaying a button inside a PopupWindow. I'd like to show a PopupMenu when the button is clicked, without closing the PopupWindow. Is this possible at all? I'm instantiating and initilizing the PopupMenu, but when I call popupMenu.show() I'm getting this error (LogCat + partial call stack): 02-25 13:31:38.281: W/WindowManager(528): Attempted to add window with token that is a sub-window: android.os.BinderProxy@41316cc8. Aborting. 02-25 13:31:51.257: D/AndroidRuntime(7643): Shutting down VM 02-25 13:31:51.257: W

How to create custom alert dialog in android?

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am developing a sample app.I am able to show alert on button click having some tittle and button .But now I want to show a pop up window having username (Label) and text field (Edit field) and a button. on click on button.can I make another popup xml file for that ? public void selfDestruct(View view) { // Kabloey Log.d("Naveen", "Test===="); System.out.println("----------------------ghfgjhf-----------------"); AlertDialog alertDialog = new AlertDialog.Builder(SecondActivity.this).create(); alertDialog.setTitle("Reset..."); alertDialog