What is the difference between view and activity in android development?

后端 未结 7 752
南旧
南旧 2021-02-04 01:37

When do I need to create a new activity and when do I need to change the view?

My app needs to do:

Screen #1

two big buttons(sort of menu)

Scr

7条回答
  •  别那么骄傲
    2021-02-04 02:27

    Activity is a screen which user sees and It is consist of different views and view group .On the other hand view is a single component which is used to build the UI. Another main difference is activity has life cycle but view doesn't. Activity - Activity is for telling what action is to be taken on touching a button or something else . Activity tell the os or the app what to do.

    Views - Views are used to create an object in the app it's about how it's going to look

提交回复
热议问题