6

Is it possible to specify the z-order of each window ? in the image below each editText are in their own window added via WindowManager. as you can see i have a z-order problem

enter image description here

like you see on the picture, the last window added seam to take the higher z-order. So the only way out i find to put a window at the higher z-order is to remove the view from windowManager and then immediately add it again. It's not very optimal solution, because visually the view disappear and reappear on the screen

zeus
  • 12,173
  • 9
  • 63
  • 184
  • Have u try to add the views into WindowManager in the inversed order ? – Tin Tran May 31 '17 at 15:51
  • It seems to me that the popup's window is added to the attached EditText' windows. – Tin Tran May 31 '17 at 15:52
  • yes, the popup's window is added to the attached editText, but the problem is that other window have an higher z-order, so i must find a way (on focusing) to set the z-order of the window containing the EditText to be the highest – zeus May 31 '17 at 16:11
  • > set the z-order of the window containing the EditText to be the highest Changing the window type of the Window `LayoutParams` will solve that ? – Tin Tran May 31 '17 at 16:13
  • you can not change the window type when the window is already added :( you must first remove it, and then add it back again and this cause an ugly flick (edit disappear and reappear) :( – zeus May 31 '17 at 17:02
  • U can use `WindowManager.updateViewLayout` to change the window type ? – Tin Tran May 31 '17 at 17:09
  • no, not when the view is already added to the windowManager :( because else i have a error "try to update the window type of an already added window" – zeus May 31 '17 at 17:39
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/145574/discussion-between-tin-tran-and-loki). – Tin Tran May 31 '17 at 17:43

0 Answers0