Hi I just started learning android development, no tutorials clearly explained the below:
What is the difference between basic activity and basic activity with fragment in android studio 2.1
Could you please help. Thanks.
Hi I just started learning android development, no tutorials clearly explained the below:
What is the difference between basic activity and basic activity with fragment in android studio 2.1
Could you please help. Thanks.
activity is a place holder for fragments, fragments (as name says are parts of an activity and placeholder for widgets which mostly are complex views ( and views are like a building blocks - they have many properties - for example they could be visible or not to user )
imagine like whole android app is like Lego :
to build a widget you connect the blocks(views, some other not visible components), to build fragment you place widgets - everything is bound by logic (code for those building blocks - which talks each to another like component of an view, fragment or an activity)
When you click on Activity, Android Studio will create a Activity, its layout file and other resources for you for free.
Similarly when you click on Activity with Fragment, Android studio will create a activity with a fragment in it. This fragment will be occupying whole width and height of the screen.