NoSuchMethodError error for getActionBar() (API-8)

后端 未结 6 1961
醉酒成梦
醉酒成梦 2020-12-17 09:59

when i run the app it installs but then crashes, ecplise isnt telling there is anything wrong with my code. i think its a problem with my manifest...



        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 10:38

    java.lang.NoSuchMethodError: com.example.secondapp.MainActivity.getActionBar

    On your MainActivity class, you call getActionBar() which is not available to your application.

    Your android:minSdkVersion is set to 8 (API-8), which does not provide getActionBar() (only since API-11).

    You should use ActionBarSherlock for good backward compatibility, or set android:minSdkVersion but then all devices < API-11 won't be targeted.

提交回复
热议问题