我得到一个 Inflate 异常, android.view.InflateException:二进制 XML 文件第 76 行:错误膨胀类, 在 XML 中添加 AdWhirl 布局并将此 XML 设置为对话框的内容 View 时,我不知道为什么会发生此异常以及如何解决它请指导我解决此问题,我认为以下代码将帮助您诊断问题所在:
这是我的 XML,我在其中添加了 Adwhirl 布局:
<LinearLayout
android:id="@+id/LinearLayout04"
android:layout_marginBottom="20dip"
android:gravity="center"
android:layout_height="250dip"
android:layout_gravity="center"
android:layout_width="fill_parent"
>
<com.adwhirl.AdWhirlLayout <!-- Exception occurred on this line-->
android:id="@+id/adwhirl_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
在 Java 代码中:
runOnUiThread(new Runnable() {
@Override
public void run() {
isShowed = true;
dialog = new Dialog(getApplicationContext());
dialog.setContentView(R.layout.replay_screen);//Exception occurred on this line
}
});
最佳答案
我已经解决了这个问题,因为现在我正在通过代码添加 AdWhirl View 。
关于android - 在 Dialog 中添加 Adwhirl 导致 Inflate Exception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7036561/