Can someone please explain why I have to use my Activity's context in my AlertDialog.Builder parameter VS getApplicationContext()? Specifically, why am I getting this error:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
I understand the differences between the two but am wondering why specifically it mentions using Theme.AppCompat
I know that it has something to do with AppCompatActivity and themes no longer being compatible but can't quite find a solid explanation on why?
The theme of my app is set to this in the styles XML file:
<style name="AppTheme" parent="Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Thank you