popupwindow

Problems creating a Popup Window in Android Activity

眉间皱痕 提交于 2019-12-17 03:56:19
问题 I'm trying to create a popup window that only appears the first time the application starts. I want it to display some text and have a button to close the popup. However, I'm having troubles getting the PopupWindow to even work. I've tried two different ways of doing it: First I have an XML file which declares the layout of the popup called popup.xml (a textview inside a linearlayout) and I've added this in the OnCreate() of my main Activity: PopupWindow pw = new PopupWindow(findViewById(R.id

Problems creating a Popup Window in Android Activity

荒凉一梦 提交于 2019-12-17 03:55:07
问题 I'm trying to create a popup window that only appears the first time the application starts. I want it to display some text and have a button to close the popup. However, I'm having troubles getting the PopupWindow to even work. I've tried two different ways of doing it: First I have an XML file which declares the layout of the popup called popup.xml (a textview inside a linearlayout) and I've added this in the OnCreate() of my main Activity: PopupWindow pw = new PopupWindow(findViewById(R.id

Problems creating a Popup Window in Android Activity

穿精又带淫゛_ 提交于 2019-12-17 03:55:06
问题 I'm trying to create a popup window that only appears the first time the application starts. I want it to display some text and have a button to close the popup. However, I'm having troubles getting the PopupWindow to even work. I've tried two different ways of doing it: First I have an XML file which declares the layout of the popup called popup.xml (a textview inside a linearlayout) and I've added this in the OnCreate() of my main Activity: PopupWindow pw = new PopupWindow(findViewById(R.id

How to create a popup window (PopupWindow) in Android

旧街凉风 提交于 2019-12-17 02:34:18
问题 To create a simple working PopupWindow, we need to do the following: popup_example.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="10dip" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="Test Pop-Up" /> </LinearLayout> Java

Android popup window dismissal

你离开我真会死。 提交于 2019-12-16 22:37:33
问题 I have a popup window displaying when I click an item in my list activity. The problem is that the back key doesn't close it. I tried catching the back key in my list activity but it doesn't register it...then I tried registering a onkeylistener to the view I'm passing to my popup window. Like this: pop.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { // TODO Auto-generated method stub boolean res=false; if (keyCode == KeyEvent

Can a View on a PopupWindow display a PopupMenu?

泄露秘密 提交于 2019-12-14 03:50:00
问题 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

Android PopupWindow showAsDropDown() not working properly

谁都会走 提交于 2019-12-14 00:29:10
问题 I am using PopupWindow with showAsDropDown(anchor). When the anchor is at the top of the screen it works fine, but when at the bottom of the screen nothing shows up. According to the documentation for PopupWindow.showAsDropDown() this should work: http://developer.android.com/reference/android/widget/PopupWindow.html#showAsDropDown%28android.view.View%29 "Display the content view in a popup window anchored to the bottom-left corner of the anchor view. If there is not enough room on screen to

Dismiss Pop up window when back button is pressed

流过昼夜 提交于 2019-12-13 19:18:59
问题 I want to dismiss the pop up window when back button is pressed. I tried with this code: popwindow.setBackgroundDrawable(new BitmapDrawable()); and it works. But in my app, pop should remain, even after touching outside of the pop up window. It should be dismissed only when back button is pressed. So I tried this: popwindow.setFocusable(false); Now its not dismissing when touched outside the pop up. But its not dismissing on back press too. I do not want to overide `onBackPressed(). Is there

Android OnKeyListener not registering Enter and Search keys.

懵懂的女人 提交于 2019-12-13 07:17:57
问题 I am using a Popup window and within that window I have a search view. Upon clicking the search view the soft keyboard comes on screen. So I want whenever I press the search button or enter button from keybaord it will get the data from the search view and will show the relevant information. I am using an OnKeyListener to get the key but it is not registering the enter and search key presses. My code: searchview.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View arg0,

Problems while displaying nvd3 pieChart in a pop up window?

扶醉桌前 提交于 2019-12-13 06:49:56
问题 I am opening nvd3 pieChart in a popup window. I create popup window like this: function openPopup(html,pos,style) { var newWindow = window.open(''); newWindow.document.write(html); return newWindow; } function openChartPopup(chartID,chartTitle) { divId = "div" + chartID; html = "<p>"+chartTitle+"</p><div id= \""+divId+"\"><svg id=\""+chartID+"\"></svg></div>"; newWindow = openPopup(html,"_blank",""); return d3.select(newWindow.document.getElementById(chartID)); } then I create a pieChart