Question

I am using the below link as a reference for integrating Mopub Banner Code to my Android application:

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

I have done with the first steps and am having a problem with the step 2 (Android Banner Code Integration)

I have included:

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

in my layout as below:

<?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>

and then I have included

private MoPubView moPubView;

but it's giving the error

'MoPubView cannto be resoled to a type'
Was it helpful?

Solution

Just clear your project along with the mopub-sdk project which is included as library into your project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top