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

后端 未结 7 750
南旧
南旧 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:11

    A View in Android is a widget that displays something. Buttons, listviews, imageviews, etc. are all subclasses of View. When you say "change view" I assume you mean change the layout by using setContentView(). This usually only needs to be done once per activity. An Activity is basically what you are referring to as a screen. To answer your question, it sounds like you need four separate activities (one for each screen).

提交回复
热议问题