You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm learning to implement SimpleStack into Compose (material3) project. Navigation seems to be works perfectly and easy to understand, but the only problem is, when I use default theme that comes when creates Compose (material3) project, it force-close and shows me error like this:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ydhnwb.learnjetpacknav/com.ydhnwb.learnjetpacknav.app.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
So, I tried to create a new theme on themes.xml like below just to make it work
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#000</item>
<item name="colorPrimaryDark">#000</item>
<item name="colorAccent">#000</item>
</style>
<!-- can i use below style? -->
<style name="Theme.LearnJetpackNav" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
then on manifest, I replaced the @styles/Theme.LearnJetpackNavTheme into @styles/AppTheme
It works, but is it okay?
Is it affecting app theme like dynamic color (for android12+) or not? I just worried about that. I also wrap my app view like this:
Simple-Stack out of the box has no dependency on AndroidX nor AppCompat at all, but Fragments and Material Components that you use, might. In that case, the theme you define should inherit from a parent theme that is requested by your views (both AppCompat alone, and Material-Components has its own themes that they expect to be used as a parent).
Yes. Since I use extends MainActivity with AppCompatActivity to get the "supportFragmentManager", I need to use AppCompat theme.
The default when creating Material3 Compose is extending MainActivity with ComponentActivity, but using it make me unable to get supportFragmentManager
I'm learning to implement SimpleStack into Compose (material3) project. Navigation seems to be works perfectly and easy to understand, but the only problem is, when I use default theme that comes when creates Compose (material3) project, it force-close and shows me error like this:
Here is my manifest.xml
So, I tried to create a new theme on themes.xml like below just to make it work
then on manifest, I replaced the @styles/Theme.LearnJetpackNavTheme into @styles/AppTheme
It works, but is it okay?
Is it affecting app theme like dynamic color (for android12+) or not? I just worried about that. I also wrap my app view like this:
Here is my repo (just in case)
*all my code is based on this extension-compose-example
The text was updated successfully, but these errors were encountered: