<commit_before>package com.zhengxiaoyao0716.baidu;

import android.app.Activity;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.baidu.appx.BDBannerAd;
import com.zhengxiaoyao0716.digimon2048.R;

public class BDBannerAdView {
    private static BDBannerAd bannerAdView;
    public static void showAdView(final Activity activity)
    {
        // 创建广告视图
        // 发布时请使用正确的ApiKey和广告位ID
        // 此处ApiKey和推广位ID均是测试用的
        // 您在正式提交应用的时候，请确认代码中已经更换为您应用对应的Key和ID
        // 具体获取方法请查阅《百度开发者中心交叉换量产品介绍.pdf》
        bannerAdView = new BDBannerAd(activity,
                "THrH0P6Mu2XQkVXynC9akAVGRm0xjxf0", "PMv9HYDpUD8QAdzcpo3jYmaG");

        // 设置横幅广告行为监听器
        bannerAdView.setAdListener(new BDBannerAd.BannerAdListener() {

            @Override
            public void onAdvertisementDataDidLoadFailure() {
                Toast.makeText(activity, R.string.loadFailed, Toast.LENGTH_LONG).show();
            }

            @Override
            public void onAdvertisementDataDidLoadSuccess() {
                Toast.makeText(activity, R.string.loadSucceed, Toast.LENGTH_LONG).show();}
            @Override
            public void onAdvertisementViewDidClick() {}
            @Override
            public void onAdvertisementViewDidShow() {}
            @Override
            public void onAdvertisementViewWillStartNewIntent() {}
        });

        ((RelativeLayout) activity.findViewById(R.id.bannerAdRl))
                .addView(bannerAdView);
    }
    public static void closeAdView(final Activity activity)
    {
        ((RelativeLayout) activity.findViewById(R.id.bannerAdRl))
                .removeView(bannerAdView);
        bannerAdView.destroy();
        bannerAdView = null;<commit_msg>修复重广告加载成功重复提示问题<commit_after>package com.zhengxiaoyao0716.baidu;

import android.app.Activity;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.baidu.appx.BDBannerAd;
import com.zhengxiaoyao0716.digimon2048.R;

public class BDBannerAdView {
    private static BDBannerAd bannerAdView;
    public static void showAdView(final Activity activity)
    {
        // 创建广告视图
        // 发布时请使用正确的ApiKey和广告位ID
        // 此处ApiKey和推广位ID均是测试用的
        // 您在正式提交应用的时候，请确认代码中已经更换为您应用对应的Key和ID
        // 具体获取方法请查阅《百度开发者中心交叉换量产品介绍.pdf》
        bannerAdView = new BDBannerAd(activity,
                "THrH0P6Mu2XQkVXynC9akAVGRm0xjxf0", "PMv9HYDpUD8QAdzcpo3jYmaG");

        // 设置横幅广告行为监听器
        bannerAdView.setAdListener(new BDBannerAd.BannerAdListener() {

            @Override
            public void onAdvertisementDataDidLoadFailure() {
                Toast.makeText(activity, R.string.loadFailed, Toast.LENGTH_LONG).show();
            }

            boolean alreadyLoaded;
            @Override
            public void onAdvertisementDataDidLoadSuccess() {
                if (alreadyLoaded) return;
                else alreadyLoaded = true;
                Toast.makeText(activity, R.string.loadSucceed, Toast.LENGTH_LONG).show();}
            @Override
            public void onAdvertisementViewDidClick() {}
            @Override
            public void onAdvertisementViewDidShow() {}
            @Override
            public void onAdvertisementViewWillStartNewIntent() {}
        });

        ((RelativeLayout) activity.findViewById(R.id.bannerAdRl))
                .addView(bannerAdView);
    }
    public static void closeAdView(final Activity activity)
    {
        ((RelativeLayout) activity.findViewById(R.id.bannerAdRl))
                .removeView(bannerAdView);
        bannerAdView.destroy();
        bannerAdView = null;
{'fraction_non_alphanumeric': 0.08367968966472707, 'fraction_numerical': 0.011637572734829594, 'mean_word_length': 2.4778420038535645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1217885', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1270, 'n_words': 165}