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
khalil
08/10/2020, 6:27 PM
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
ZariApps
08/10/2020, 6:28 PM
So there isn't a best practice? seems like new layout is easier to do 🙂
k
khalil
08/10/2020, 6:44 PM
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
ZariApps
08/10/2020, 6:46 PM
gotcha. i am going to create a new activity. i havent learned fragments yet(at least by name)