i want use viewstub real time titlebar change

main.xml

*<**ViewStub*

        *android:id**=**"@+id/headerstub"*

        *android:layout_gravity**=**"top"*

        *android:layout_width**=**"match_parent"*

        *android:layout_height**=**"wrap_content"*

        *android:inflatedId**=**"@+id/titleArea"*

        *android:layout**=**"@layout/title_one"* */>*

title_one.xml
some controls

titile_two.xml
some controls


i want change title_one and title_two toggle
here is my code

 titleBar = (ViewStub)findViewById(R.id.headerstub);

 titleBar.setLayoutResource(R.layout.title_one);

 titleBar.inflate();


some event change to title_two

titleBar.setLayoutResource(R.layout.title_two);

titleBar.inflate();<<<< crash app

logcat message : ViewStub must have a non-null ViewGroup viewParent

how can reuse viewstub?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to