Search code examples
androidandroid-custom-viewinstantiation

Android: Custom view fails to instantiate


I am trying to add Smaato to my app to monotize it. I have been following the developers guide but I keep getting the error that my custom view for the banner isn't being instantiated. I have the custom view wrapped in a relative layout:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_alignParentBottom="true" android:id="@+id/adcontainer"
    android:layout_height="50dip" android:background="#666">
        <com.smaato.SOMA.SOMABanner android:id="@+id/BannerView"
            android:layout_width="fill_parent" android:layout_height="50dip" />
    </RelativeLayout>

I follow the other steps, but no where does it seem to show how to instantiate the view. Any ideas how to do this?


Solution

  • com.smaato.SOMA.SOMABanner must be a public class with a constructor public SOMABanner(Context context, AttributeSet attributeSet).