public static void adds_offline(Context context, final LinearLayout layout) {
AdView adView = new AdView(context);
adView.setAdUnitId("ca-app-pub-4267540560263635/4160942451");
adView.setAdSize(AdSize.SMART_BANNER);
layout.addView(adView);
adView.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
layout.setVisibility(View.VISIBLE);
}
});
AdRequest request = new AdRequest.Builder().build();
adView.loadAd(request);
}