hi guys! im brand new, i am learning development/k...
# android
z
hi guys! im brand new, i am learning development/kotlin. quick question. i have a button that should lead to a new page. does that mean i should create a new layout or a brand new activity?
k
maybe! you can use fragments to change a layout, but you will need to create a new layout file and a fragment, or you can create a new activity
z
So there isn't a best practice? seems like new layout is easier to do 🙂
k
Sorry, Let me try explain again: When there is a behaviour to show another screen, there two ways to do that. Creating a new Activity or using fragments and use the same Activity... on both ways you need to create a new layout file and in both ways you need to create a new file that represents this layout in code like
NewActivity.kt
or
NewFragment.kt
z
gotcha. i am going to create a new activity. i havent learned fragments yet(at least by name)
👍 1
@khalil thank you
k
you r welcome man!