简体   繁体   English

更新android sdk r12之后的android自定义警报对话框错误

[英]Android Custom Alert Dialog Error after updating android sdk r12

I got the following error after updating my android sdk revision to r12. 将android sdk版本更新为r12后,出现以下错误。

error: Error retrieving parent for item: No resource found that matches the given name '@android:style/AlertDialog'.

Here is my xml file. 这是我的xml文件。

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CustomDialogTheme" parent="@android:style/AlertDialog">
        <item name="android:windowFrame">@null</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowAnimationStyle">@android:style/Theme.Dialog</item>
    </style>
</resources>

I didn't change anything in the code and the only thing that I did was upgraded the Android SDK. 我没有更改代码中的任何内容,唯一要做的就是升级了Android SDK。

android:style/AlertDialog is not a public style and you should not use it. android:style/AlertDialog不是公共样式,您不应使用它。 Please refer to this thread How to change theme for AlertDialog 请参考此主题如何更改AlertDialog的主题

Finaly i found the answer . 最后,我找到了答案。 i know its not the proper way but it works for now. 我知道这不是正确的方法,但目前可以使用。

I managed to fix it by replacing the platform-tools_r06 with platform-
tools_r05 in android sdk folder

you can dowload platform-tools-r05 from here . 您可以从此处下载platform-tools-r05。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM