B basil99 Active Member Licensed User Longtime User Mar 19, 2013 #1 Hi! My code use CustomDialog with panel holding some views. When I tap HOME button and then go back to application, CustomDialog vanished, but any later call of CustomDialog fires an error message: java.lang.illegalstateexcaption: the specified child already has a parent. you must call removeView() on the child's parent first Code is: Code: Copy result = MyDialog.Show( captionString, "Ок", "Cancel","", Null ) and panel with different views was Initialized before in this way: Code: Copy MyDialog.AddView( MyPanel, 0, 0, 100%x, 100%y ) So, all works fine, exept this. What I need to do to prevent this error message ? Thank you
Hi! My code use CustomDialog with panel holding some views. When I tap HOME button and then go back to application, CustomDialog vanished, but any later call of CustomDialog fires an error message: java.lang.illegalstateexcaption: the specified child already has a parent. you must call removeView() on the child's parent first Code is: Code: Copy result = MyDialog.Show( captionString, "Ок", "Cancel","", Null ) and panel with different views was Initialized before in this way: Code: Copy MyDialog.AddView( MyPanel, 0, 0, 100%x, 100%y ) So, all works fine, exept this. What I need to do to prevent this error message ? Thank you
thedesolatesoul Expert Licensed User Longtime User Mar 19, 2013 #2 call remove view before you add the views again. Sent from my GT-I9305 using Tapatalk 2 Upvote 0
B basil99 Active Member Licensed User Longtime User Mar 19, 2013 #3 thedesolatesoul said: call remove view before you add the views again. Sent from my GT-I9305 using Tapatalk 2 Click to expand... Remove what view ? My Panel ? Like that ? Code: Copy MyDialog.AddView( MyPanel, 0, 0, 100%x, 100%y ) result = MyDialog.Show( captionString, "Ок", "Cancel","", Null ) MyPanel.RemoveView correct ? Upvote 0
thedesolatesoul said: call remove view before you add the views again. Sent from my GT-I9305 using Tapatalk 2 Click to expand... Remove what view ? My Panel ? Like that ? Code: Copy MyDialog.AddView( MyPanel, 0, 0, 100%x, 100%y ) result = MyDialog.Show( captionString, "Ок", "Cancel","", Null ) MyPanel.RemoveView correct ?
B basil99 Active Member Licensed User Longtime User Mar 19, 2013 #4 well, tried code above, but got the same error. But this seems works fine: Code: Copy MyPanel.RemoveView MyDialog.AddView( MyPanel, 0, 0, 100%x, 100%y ) result = MyDialog.Show( captionString, "Ок", "Cancel","", Null ) Thanks for the idea ! Last edited: Mar 19, 2013 Upvote 0
well, tried code above, but got the same error. But this seems works fine: Code: Copy MyPanel.RemoveView MyDialog.AddView( MyPanel, 0, 0, 100%x, 100%y ) result = MyDialog.Show( captionString, "Ок", "Cancel","", Null ) Thanks for the idea !