E Ederson Kerber Member Licensed User Feb 21, 2017 #1 Good Morning, I'm using the theme in a version posted at: https://www.b4x.com/android/forum/threads/theme-based-on-version-tutorial.27624/ by @barx in an example provided by @Erel However, I'm encountering difficulties when I use the version-based theme with an extension: android.support.v7.app.AppCompatActivity. Here is the error: java.lang.RuntimeException: Unable to start activity ComponentInfo{barxdroid.VersionThemeDemo/barxdroid.VersionThemeDemo.main}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. P.S: When taking the attribute "Extends: android.support.v7.app.AppCompatActivity" the error does not happen, however, I must use the same in my application. I need to use android.support.v7.app.AppCompatActivity due to Android version compatibility. Thanks, I appreciate that you can help. Attachments log.JPG 118.9 KB · Views: 764 main.JPG 54.2 KB · Views: 789 manifest.JPG 51.7 KB · Views: 811
Good Morning, I'm using the theme in a version posted at: https://www.b4x.com/android/forum/threads/theme-based-on-version-tutorial.27624/ by @barx in an example provided by @Erel However, I'm encountering difficulties when I use the version-based theme with an extension: android.support.v7.app.AppCompatActivity. Here is the error: java.lang.RuntimeException: Unable to start activity ComponentInfo{barxdroid.VersionThemeDemo/barxdroid.VersionThemeDemo.main}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. P.S: When taking the attribute "Extends: android.support.v7.app.AppCompatActivity" the error does not happen, however, I must use the same in my application. I need to use android.support.v7.app.AppCompatActivity due to Android version compatibility. Thanks, I appreciate that you can help.
Erel B4X founder Staff member Licensed User Longtime User Feb 21, 2017 #2 See AppCompat tutorial: https://www.b4x.com/android/forum/t...compatible-with-older-android-versions.48423/ You must use one of the AppCompat themes (or a custom theme that extends an AppCompat theme). Upvote 0
See AppCompat tutorial: https://www.b4x.com/android/forum/t...compatible-with-older-android-versions.48423/ You must use one of the AppCompat themes (or a custom theme that extends an AppCompat theme).