android-popupwindow

show popup window on lock screen

十年热恋 提交于 2019-12-12 04:55:23
问题 I have implemented a caller ID feature where when the screen is locked it should open the lock and show the popup with the name of the person calling. this is the code i've added in the onCreate() of the PopupActivity. getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager

popup window is not properly shown in android L

混江龙づ霸主 提交于 2019-12-11 07:14:53
问题 this is how it looks like on android L : where as on jelly bean it looks like : here is layout xml file: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:customfont="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:background="@color/black_bg_dialog" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_marginRight="30dp" android:layout

Dimmed Background of PopupWindow excludes Toolbars / Action Bars

十年热恋 提交于 2019-12-11 01:59:16
问题 I use the following codes to create a PopupWindow with dim background by clicking a menu item in Toolbar : @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case R.id.btn_1: Log.i(TAG, "Clicked Button 1"); LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE); View popupView = layoutInflater.inflate(R.layout.popup_window, null); final PopupWindow popupWindow = new PopupWindow(popupView, Toolbar

EditText setError not working in PopupWindow

試著忘記壹切 提交于 2019-12-10 15:56:13
问题 I had popup window with custom layout which has edittext . I'm trying to show error message in edittext with setError method, but it's giving following exception. android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@211ffd68 is not valid; is your activity running? at android.view.ViewRootImpl.setView(ViewRootImpl.java:579) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:282) at android.view.WindowManagerImpl.addView

Android Listview in PopupWindow onitemclick not work on some device

旧城冷巷雨未停 提交于 2019-12-06 19:14:11
问题 My ListView is inside PopupWindow. When i shown PopupWindow and click on Listview row in device ASUS K00z fonepad worke very well. But in HTC Z715e is not working (onitem click event not fired) 1.This is my listview item layout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ln_testpopitemcon" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="52dp" android:background="#3b8ed4" android:descendantFocusability=

How to display popup instead of CAB when textview is selected?

我的未来我决定 提交于 2019-12-06 06:59:48
问题 I am making a reading app and it has a full screen activity. When user selects the part of the text a contextual action bar appears with option of copy. This is the default behaviour. But this actionbar blocks the text under it so user cannot select it. I want to show a popup window like below. I tried returning false from onCreateActionMode but when i do this i can't select the text either. I want to know if there is a standart way to achieve this as many reading applications use this design

Android Listview in PopupWindow onitemclick not work on some device

混江龙づ霸主 提交于 2019-12-05 00:45:08
My ListView is inside PopupWindow. When i shown PopupWindow and click on Listview row in device ASUS K00z fonepad worke very well. But in HTC Z715e is not working (onitem click event not fired) 1.This is my listview item layout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ln_testpopitemcon" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="52dp" android:background="#3b8ed4" android:descendantFocusability="blocksDescendants"> <ImageView android:id="@+id/img_testiconmenu" android:layout_margin="10dp" android

dismiss the popup window by back button

点点圈 提交于 2019-12-03 18:01:53
问题 I want to Dismiss the popup window by clicking outside of the popup window or by the back button, but when click on the back button my application exit's, instead of exiting the application I want to close the popup window. here is my code, ivmainmenu.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub LayoutInflater layoutInflater = (LayoutInflater)getBaseContext() .getSystemService(LAYOUT_INFLATER_SERVICE); View popupView =

How to show whatsapp like popup notification when app is in background?

南楼画角 提交于 2019-12-03 15:20:02
问题 I have to set reminder in my app. So, Once the reminder time is reached , app has to show one popup window (Even if the app is not running) , just like how WhatsApp shows messages in popup when it is not running On tapping the button I have to launch my app also. How can I display one popup from background? Is there any samples available? Thanks in advance 回答1: You can use SYSTEM_ALERT_WINDOW from your BroadcastReceiver to show one dialog window , which will be shown on top of all other apps.

how to make animation for popup window in android

落爺英雄遲暮 提交于 2019-12-03 04:04:44
问题 I hava a popup window in my application, its appears when some button clicked I want to set fade in animation to this window, I put the xml file in "res/anim" folder and set the animation style for the popup window but the animation does not work? here is my codes: myanim.xml... <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:interpolator="@android:anim/accelerate_interpolator"