首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >amazon ads呈现问题

amazon ads呈现问题
EN

Stack Overflow用户
提问于 2013-07-30 04:06:45
回答 1查看 170关注 0票数 0

我已经能够让广告出现在我的xml布局中的代码,但有一个问题。代码确实按预期构建和执行,但在xml编辑器中,布局被如下错误阻塞:

渲染问题无法实例化以下类:- com.amazon.device.ads.AdLayout (Open Class,显示异常)提示:在自定义视图中使用View.isInEditMode()可以跳过代码或显示示例数据,这些异常详细信息显示在android.os.Environment.getExternalStorageState com.amazon.device.ads.DebugProperties.readDebugProperties(DebugProperties.java:75)的com.amazon.device.ads.InternalAdRegistration.(InternalAdRegistration.java:52) com.amazon.device.ads.InternalAdRegistration.(InternalAdRegistration.java:48)的IDE Exception Details java.lang.NullPointerException中。(AdLayout.java:186)在com.amazon.device.ads.AdLayout.initialize(AdLayout.java:177) AdLayout.java:186工作...

这是我的xml布局

代码语言:javascript
复制
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background5"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:id="@+id/MainLayout"
tools:context=".MainActivity">


//start button
<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Start"
        android:background="#19d2b2"
        android:id="@+id/start_button"
        android:layout_above="@+id/instructions_button5"
        android:layout_centerHorizontal="true"/>

//Instructions button
<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Instructions"
        android:background="#19d2b2"
        android:id="@+id/instructions_button6"

        android:layout_below="@+id/start_button"
        android:layout_alignLeft="@+id/start_button"
        android:layout_marginTop="10dp"/>

<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Gallery"
        android:background="#19d2b2"
        android:id="@+id/save_button"
        android:layout_below="@+id/instructions_button6"
        android:layout_alignParentRight="true"
        android:layout_marginTop="10dp"/>

<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Scores"
        android:id="@+id/Scores"
        android:background="#19d2b2"
        android:layout_below="@+id/save_button"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"/>

<com.amazon.device.ads.AdLayout
        android:id="@+id/adview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="500dp"/>

有没有人知道有没有解决这个问题的方法,或者有更多关于什么可能导致这个问题的信息?

EN

回答 1

Stack Overflow用户

发布于 2015-07-09 03:06:13

同样的事情也发生在我身上。xml设计编辑器应该向您展示布局的外观。尝试模拟您的应用程序或将其连接到实际设备。它应该还能工作。但是,对于带有ad-view的布局,您总是会遇到渲染问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17933209

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档