IllegalStateException in my Android app caused by Theme.AppCompat

前端 未结 1 527
刺人心
刺人心 2021-01-26 11:19

I get a NPE when I try to launch the App. I don\'t know what causes it. The App should show a map at a website. Then the User can easily type his location into the edittext and

1条回答
  •  生来不讨喜
    2021-01-26 12:10

    You need to use a Theme.AppCompat theme (or descendant) with this activity.
    

    You have

    public class MainActivity extends ActionBarActivity
    

    You are using ActionBar from support library and you need to have Theme.AppCompat for your activity

    Apply AppCompat theme for the activity in manifest file.

    
                                                            
0 讨论(0)
提交回复
热议问题