How to fix: “You need to use a Theme.AppCompat theme (or descendant) with this activity”

后端 未结 4 1115
傲寒
傲寒 2020-11-28 09:36

I am having trouble running my Android app in a fullscreen mode per instructions of a video. When it tries to run, the app crashes with the error.

\"You need t

4条回答
  •  广开言路
    2020-11-28 10:31

    Your application has an AppCompat theme

    
    

    But, you overwrote the Activity (which extends AppCompatActivity) with a theme that isn't descendant of an AppCompat theme

    
    

    You could define your own fullscreen theme like so (notice AppCompat in the parent=)

    
    

    Then set that on the Activity.

    
    

    Note: There might be an AppCompat theme that's already full screen, but don't know immediately

提交回复
热议问题