This is a migrated thread and some comments may be shown as answers.

Unable to add window -- token android.view.ViewRootImpl$W@c8be37d is not valid

1 Answer 528 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nico
Top achievements
Rank 1
Veteran
Iron
Nico asked on 11 Feb 2021, 11:45 AM

Hello!
I have a popu that has a contentview with a radcombobox.
When I want to open the combobox to show the elements my application crashes with the following exception:

"Android.Views.WindowManagerBadTokenException: 'Unable to add window -- token android.view.ViewRootImpl$W@c8be37d is not valid; is your activity running?'"

What is wrong here?

Best regards,
Nico

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 11 Feb 2021, 03:02 PM

Hello Nico,

It seems you've come upon a known limitation related to Android PopupWindow - in short you cannot open a popup from a popup. In the concrete case the ComboBox dropdown is the second popup.  

I am afraid the result is that placing a RadComboBox inside a RadPopup is a not-supported scenario on Android.

Let me know if I can assist with anything else.

Regards,
Yana
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Kjell
Top achievements
Rank 1
commented on 15 Aug 2023, 06:36 PM

Hi Yana,

We are running into this same issue and were wondering if this known limitation has been addressed and fixed in recent versions of Telerik for Xamarin, or if this is still a limitation with your software? We are currently running Telerik.UI.for.Xamarin: 2022.1.117.1

 

Kind Regards.

Lance | Manager Technical Support
Telerik team
commented on 15 Aug 2023, 06:54 PM

HI Kjell, the limitation is with Android OS, rather than something with the Telerik UI for Xamarin components. So, an update on our side will not resolve this situation as the native view system doesn't allow for multiple nested Android PopupWindow objects.

To explain further with this scenario: when you open a RadPopup, it is already in a PopupWindow. Now, when you have a RadComboBox inside that first popup, the RadComboBox's popup is the 2nd illegal one that is not allowed on Android.

So I'm afraid that you'll need to consider an alternative UX approach instead of multiple nested popups. For example, instead of using a ComboBox in the RadPopup.Content, use a list control (e.g., NonVirtualizedItemsControl or RadListView). You can always dynamically show/hide the full list based on whether or not the user has made a suggestion yet with the IsVisible property of the list.

Tags
ComboBox
Asked by
Nico
Top achievements
Rank 1
Veteran
Iron
Answers by
Yana
Telerik team
Share this question
or