D Declan Well-Known Member Licensed User Longtime User Sep 10, 2017 #1 Is it possible to get the index of a View? I have two spinner views. Spinner1 loads Spinner2. When both spinners are loaded and visible and the user clicks Spinner1, I get the following error: Code: Copy java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. I would like to use "Activity.RemoveViewAt( )" to remove Spinner2
Is it possible to get the index of a View? I have two spinner views. Spinner1 loads Spinner2. When both spinners are loaded and visible and the user clicks Spinner1, I get the following error: Code: Copy java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. I would like to use "Activity.RemoveViewAt( )" to remove Spinner2
JordiCP Expert Licensed User Longtime User Sep 10, 2017 #2 You can also use Code: Copy Spinner2.removeView Upvote 0
KMatle Expert Licensed User Longtime User Sep 10, 2017 #3 Or just set the visibility with Code: Copy Spinner2.Visible = True/False if the layout is static and you just want to show/hide the 2nd or even a 3rd spinner Upvote 0
Or just set the visibility with Code: Copy Spinner2.Visible = True/False if the layout is static and you just want to show/hide the 2nd or even a 3rd spinner