How to Create Dialog Box with Banner Ads in Sketchware
LinearLayout mylayout = new LinearLayout(MainActivity.this);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
mylayout.setLayoutParams(params); mylayout.setOrientation(LinearLayout.VERTICAL);
mylayout.setPadding(0, 20, 0, 10);
final com.google.android.gms.ads.AdView adview1 = new com.google.android.gms.ads.AdView(MainActivity.this);
adview1.setAdSize(com.google.android.gms.ads.AdSize.MEDIUM_RECTANGLE); adview1.setAdUnitId("ca-app-pub-3940256099942544/6300978111"); adview1.loadAd(new com.google.android.gms.ads.AdRequest.Builder().build());
mylayout.addView(adview1);
dialog.setView(mylayout);
Comments
Post a Comment