https://kotlinlang.org logo
#anko
Title
# anko
n

nickk

07/14/2017, 8:19 AM
Hi. What is the suggested way to include a fragment in an anko layout? There is no
fragment
function in the DSL.
m

miha-x64

07/14/2017, 9:35 AM
You can add fragments programmatically, using
beginTransaction()
and so on.
n

nickk

07/14/2017, 10:01 AM
So I need to create a placeholder for my Fragment too? A
FrameLayout
?
m

miha-x64

07/14/2017, 11:45 AM
You can add your fragment wherever you want, including Activity root —
android.R.id.content
.
n

nickk

07/14/2017, 11:47 AM
@miha-x64 Well, I tried to add it inside an
alert
with
customView
, and it doesn’t seem to work. On a regular Activity it worked fine.
6 Views