android - The specified child already has a parent -


i don't know happening. code crashing , dont find reason.

i've linearlayout container of several webviews.

linearlayout variablecontent = (linearlayout) this.findviewbyid(r.id.variablecontent); (int i=0; i<5;i++){     xmlmodule modul = modulsrecuperats.get(i);     mywebview webview = new mywebview(this);     webview customwebviewcontainer = (webview) this.minflater.inflate(r.layout.customwebview, null);     customwebviewcontainer = webview._clientsettings(customwebviewcontainer,progressdialog);     customwebviewcontainer.loaddata(modul.getcontent(), "text/html", "utf-8");     variablecontent.addview(customwebviewcontainer); } 

and code crashes when addview called. error:

caused by: java.lang.illegalstateexception: specified child has parent. must call removeview() on child's parent first.

i can't find reason. can me out?

the problem customwebviewcontainer has parent. view cannot have 2 parents, exception thrown. can assume call webview._clientsettings() wrapping view container.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -