I hear you. I do exactly the same thing. Very unhappy though with fill rate of MM...some days I am closer to 30%....they do pay highest though. The code below should work for you. One thing is that the ads that come in from MM are padded, so some tweaks with layout had to be done.
private static void appendAdWhirl(final Activity activity, int id) {
LinearLayout layout = (LinearLayout)activity.findViewById(id);
final AdWhirlLayout adWhirlLayout = new AdWhirlLayout(activity, "ADWHIRLIDHERE");
adWhirlLayout.setAdWhirlInterface(new AdWhirlInterface() {
@Override
public void adWhirlGeneric() {
final String MYAPID = "MILLENNIALIDHERE";
LinearLayout myLayout = new LinearLayout(activity);
myLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
//MM SDK shows other things you can send to them as well
Hashtable<String, String> map = new Hashtable<String, String>();
map.put("keywords", "SOMEKEYWORDS");
//set to 0 since you will use refresh timer on adwhirl
MMAdView adview = new MMAdView(activity, MYAPID, 0, map);
adview.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
myLayout.addView(adview);
adview.setVerticalScrollBarEnabled(false);
adview.setHorizontalScrollBarEnabled(false);
adWhirlLayout.pushSubView(myLayout);
}
});
RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, 51);
layout.addView(adWhirlLayout, adWhirlLayoutParams);
layout.invalidate();