Note that there are some explanatory texts on larger screens.

plurals
  1. POAdWhirl not rendering Android
    text
    copied!<p>I am using Adwhirl first time in our apps but no joy.. Adwhirl supplied this demo code but it prompt an error "java.lang.ClassCastException: android.widget.LinearLayout" on selected line below please</p> <pre><code> AdWhirlManager.setConfigExpireTimeout(1000 * 60 * 5); AdWhirlTargeting.setAge(23); AdWhirlTargeting.setGender(AdWhirlTargeting.Gender.MALE); AdWhirlTargeting.setKeywords("online games gaming"); AdWhirlTargeting.setPostalCode("94123"); AdWhirlTargeting.setTestMode(false); ***AdWhirlLayout adWhirlLayout = (AdWhirlLayout) findViewById(R.id.layout_ad);*** TextView textView = new TextView(this); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); int diWidth = 320; int diHeight = 52; int density = (int) getResources().getDisplayMetrics().density; adWhirlLayout.setAdWhirlInterface(this); adWhirlLayout.setMaxWidth((int) (diWidth * density)); adWhirlLayout.setMaxHeight((int) (diHeight * density)); layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL); textView.setText("Below AdWhirlLayout"); LinearLayout layout = (LinearLayout) findViewById(R.id.test_layout); layout.setGravity(Gravity.CENTER_HORIZONTAL); layout.addView(adWhirlLayout, layoutParams); layout.addView(textView, layoutParams); layout.invalidate(); </code></pre> <p>XML here</p> <p> </p> <pre><code>&lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom" android:id="@+id/layout_ad" /&gt; </code></pre> <p></p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload