Show a Fragment in FrameLayout without element in layout editor?
Show a Fragment in FrameLayout without <fragment> element in layout editor?
I know that tools:layout
can be used to show a fragment in <fragment>
elements in the Android Studio's layout editor.
tools:layout
<fragment>
However, I want to add a fragment in a FrameLayout at runtime (so that I can change the fragment).
Similar questions found in SO like Question 1 and Question 2, but the answers in the pages cannot solve the problem exactly.
What I want to do is:
<fragment>
<include>
tools:layout
<fragment>
View.isInEditMode
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment