3

I want to create dialog with adMob , but it always gives an error , that its not enough place to put it . so is it possible to make dialog width equal to screen width ?

here is how i create it all :

public void CreateDialog(){
    Dialog d = new Dialog(this);
    d.setTitle("Loading...");
    LinearLayout ll = new LinearLayout(d.getContext());
    ll.setLayoutParams( new  LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
    ll.addView(adView);
    d.setContentView(ll);
    d.show();
}

// AdView is loading normally , and working without dialog;

ilbets
  • 710
  • 1
  • 9
  • 35
  • Out of curiosity, why would you want to show an ad in a dialog box? Isn't that for alerts and to prompt the user? – Ahmed Faisal Mar 28 '13 at 13:37
  • em... I just need to show it in the dialog , alertDialog or something like that . – ilbets Mar 28 '13 at 13:54
  • this is a late reply for sure any how but http://stackoverflow.com/questions/13779629/admob-ad-on-custom-dialog help you. – AshMv Jul 30 '13 at 18:52

0 Answers0