【发布时间】:2014-07-22 15:56:34
【问题描述】:
我今天刚刚开始玩 android/sdk 很抱歉这个非常愚蠢的问题,但我正在学习。
我正在使用 Eclipse,我已将一些代码放入项目的 java 文件中,以便将应用程序连接到广告服务器,它工作正常,当我启动应用程序时,我得到了我的广告横幅。 我已经导入了 android sdk 和广告服务提供商 sdk。
现在,我想在布局 xml 中创建的一些对象之间插入横幅。
所以,我在布局文件夹下有 fragment_main.xml,我在其中放置了以下 xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:opensdk="http://schemas.android.com/apk/res/com.example.myfirstapp"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage" />
<com.appnexus.opensdk.BannerAdView
android:id="@+id/banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:placement_id="YOUR PLACEMENT ID"
android:auto_refresh="true"
android:auto_refresh_interval="30"
android:opens_native_browser="true"
android:adWidth="320"
android:adHeight="50"
android:should_reload_on_resume="true"
android:opens_native_browser="true"
android:expands_to_fit_screen_width="false"
/>
现在对应
<com.appnexus.opensdk.BannerAdView
我收到此错误:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'auto_refresh_interval' in package 'android'
- error: No resource identifier found for attribute 'adHeight' in package 'android'
- error: No resource identifier found for attribute 'expands_to_fit_screen_width' in package
'android'
- error: No resource identifier found for attribute 'should_reload_on_resume' in package
'android'
- error: No resource identifier found for attribute 'placement_id' in package 'android'
- error: No resource identifier found for attribute 'adWidth' in package 'android'
- error: No resource identifier found for attribute 'opens_native_browser' in package 'android'
- error: No resource identifier found for attribute 'auto_refresh' in package 'android'
那么,我在哪里声明所有这些属性?它一定与这条路径有关: xmlns:opensdk="http://schemas.android.com/apk/res/com.example.myfirstapp"
如果您能提供帮助,请告诉我,对于糟糕的信息,我们深表歉意!
【问题讨论】: