1

我使用以下链接作为集成Mopub Banner Code到我的Android应用程序的参考:

https://app.mopub.com/inventory/adunit/9e96b9fc658144c7a6abd0407ed21187/generate/?status=welcome

我已经完成了第一步,但第 2 步有问题(Android Banner Code Integration

我已经包括:

<com.mopub.mobileads.MoPubView
    android:id="@+id/adview"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    />

在我的布局如下:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:background="@drawable/background_activated">

  <CheckBox android:id="@+id/crime_list_item_solvedCheckBox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_alignParentRight="true"
    android:enabled="false"
    android:focusable="false"
    android:padding="4dp" />
  <TextView android:id="@+id/crime_list_item_titleTextView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_toLeftOf="@id/crime_list_item_solvedCheckBox"
    android:textStyle="bold"
    android:paddingLeft="4dp"
    android:paddingRight="4dp"
    android:text="Crime title" />

  <TextView android:id="@+id/crime_list_item_dateTextView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/crime_list_item_titleTextView"
    android:layout_toLeftOf="@id/crime_list_item_solvedCheckBox"
    android:paddingLeft="4dp"
    android:paddingRight="4dp"
    android:paddingTop="4dp"
    android:text="Crime date" />

  <com.mopub.mobileads.MoPubView
    android:id="@+id/adview"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    />
</RelativeLayout>

然后我包括了

private MoPubView moPubView;

但它给出了错误

'MoPubView cannto be resoled to a type'
4

1 回答 1

0

只需清除您的项目以及mopub-sdk作为库包含在项目中的项目即可。

于 2014-03-24T15:49:26.980 回答