“You need to use a Theme.Appcompat theme…” when testing ActionBarActivity, but I am

后端 未结 2 1996
夕颜
夕颜 2021-02-01 14:34

I have a problem when testing an app which uses ActionBarActivity from android-support-v7-appcompat via Android JUnit test in Eclipse. When running in an emulator or device ever

相关标签:
2条回答
  • 2021-02-01 14:47

    add android:theme="@style/Theme.AppCompat" under application in your manifest.xml

    0 讨论(0)
  • 2021-02-01 15:02

    There are 2 things I'd try:

    • Remove the setTheme from onCreate, it is redundant with the manifest and may lead to confusion
    • Set the theme at Application instead of Activity level in the manifest
    0 讨论(0)
提交回复
热议问题