What is the meaning of that exception
ava.lang.IllegalStateException: ViewStub must have a non-null ViewGroup viewParent
i am creating an array of View Stub and adding them to a linearLayout but this exception is showing at run time
for(int i=0;i<1;i++)
{
try
{
stub[0]=new ViewStub(getApplicationContext(),R.layout.view_stub_layout);
//Viewv=stub[i].inflate(getApplicationContext(),R.layout.view_stub_layout,mainLayout);
//stub[0].setLayoutResource(R.layout.view_stub_layout);
View v;
v=stub[0].inflate();
mainLayout.addView(v);
v=null;
}
catch(Exception e){
e.getMessage();
}
}