에몽이

alert dialog 사용시 appCompat 오류 해결법 본문

android

alert dialog 사용시 appCompat 오류 해결법

ian_hodge 2016. 12. 24. 15:30

Basically your Activity is using Toolbar (which replaces Action Bar) so you need to use style for the Activity that has no Action Bar like Theme.AppCompat.Light.NoActionBar. If you have your own style for dialog then you need to inherit the proper AppCompat theme.

<style name="myDialog" parent="Theme.AppCompat.Dialog">
    <item name="android:windowNoTitle">true</item>
    ...
</style>

AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.myDialog));
shareedit


출처:

http://stackoverflow.com/questions/30180052/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity-chan

Comments