According to the content of the error message, it can be seen that this error is caused by the androidx.appcompat:appcompat-resources version in your project’s dependent library being incompatible with your compileSdkVersion. The error message shows that the minimum compilation version (minCompileSdk) specified in the AAR metadata file of the dependent library androidx.appcompat:appcompat-resources is 33, and […]
Tag: appcompat
Decompiled You need to use a Theme.AppCompat theme (or descendant) with this activity.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.activitylifecycletest/com.example.activitylifecycletest.DialogActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThreadH.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInitMethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:103) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with […]
Monitor the life cycle changes of Fragment in AppCompatActivity
Foreword In daily development, it is often necessary to use Fragment. Fragment exists attached to Activity, so how to monitor the life cycle changes of Fragment in Activity? Scheme Since Fragment exists attached to Activity, can we register the life cycle callback of Fragment? The answer is yes, we can realize the life cycle callback […]
[Solved] You need to use a Theme.AppCompat theme (or descendant) with this activity.
@[TOC](You need to use a Theme.AppCompat theme (or descendant) with this activity. in Android error message.) 1. The following error is reported The reason is: Activty inherits from android.support.v7.app.AppCompatActivty, not android.app.Activty. 2. Solutions Look at the prompt, that is, use AppCompat in Theme to change the theme used in AndroidManifist.xml. <activity android:name=”.activity.GywmActivity” android:label=”About us” android:theme=”@style/Theme.AppCompat.Dialog”> […]