當前位置: 首頁>>代碼示例>>Java>>正文


Java AdView.destroy方法代碼示例

本文整理匯總了Java中com.google.android.gms.ads.AdView.destroy方法的典型用法代碼示例。如果您正苦於以下問題:Java AdView.destroy方法的具體用法?Java AdView.destroy怎麽用?Java AdView.destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.ads.AdView的用法示例。


在下文中一共展示了AdView.destroy方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: destroyAd

import com.google.android.gms.ads.AdView; //導入方法依賴的package包/類
public static void destroyAd(Activity activity) {
	if (!AD_ENABLED) {
		return;
	}
	View adLayout = activity == null ? null : activity.findViewById(R.id.ad_layout);
	if (adLayout != null) {
		AdView adView = (AdView) adLayout.findViewById(R.id.ad);
		if (adView != null) {
			try {
				adView.removeAllViews();
				adView.destroy();
			} catch (Throwable t) {
				MTLog.w(TAG, t, "Error while destroying ad view!");
			}
		}
	}
	adLoaded = null;
	TaskUtils.cancelQuietly(setupAdTask, true);
	setupAdTask = null;
}
 
開發者ID:mtransitapps,項目名稱:mtransit-for-android,代碼行數:21,代碼來源:AdsUtils.java

示例2: onDestroy

import com.google.android.gms.ads.AdView; //導入方法依賴的package包/類
@Override
public void onDestroy() {
    super.onDestroy();
    EventBus.getDefault().unregister(this);
    if (bp != null) {
        bp.release();
    }
    if (!Monetize.isAdsRemoved()) {
        for (AdView adView : adViewTiers) {
            if (adView != null) {
                adView.destroy();
            }
        }
    }
}
 
開發者ID:jrummyapps,項目名稱:BusyBox,代碼行數:16,代碼來源:MainActivity.java

示例3: destroyAdView

import com.google.android.gms.ads.AdView; //導入方法依賴的package包/類
public void destroyAdView(int id, Activity activity) {
    AdView adView = window.getAdView(id, activity);
    if (adView != null) {
        adView.destroy();
        Log.d(TAG, "ad destroyed");
    }
}
 
開發者ID:berict,項目名稱:Tapad,代碼行數:8,代碼來源:AdMobHelper.java

示例4: onPurchasesUpdated

import com.google.android.gms.ads.AdView; //導入方法依賴的package包/類
@Override
public void onPurchasesUpdated(@BillingClient.BillingResponse int responseCode, List<Purchase> purchases) {
    if (responseCode == BillingClient.BillingResponse.OK && purchases != null) {
        if(getView() != null) {
            // Apply preference
            SharedPreferences settings = getActivity().getSharedPreferences(PREFS_NAME, 0);
            SharedPreferences.Editor editor = settings.edit();
            editor.putBoolean("donationPurchased", true);
            editor.apply();

            // Destroy Ad
            AdView mAdView = getActivity().findViewById(R.id.adView);
            mAdView.setVisibility(GONE);
            mAdView.destroy();

            showDonatorStatus();
        }
    } else if (responseCode == BillingClient.BillingResponse.USER_CANCELED) {
        // Handle an error caused by a user cancelling the purchase flow.
        if(getView() != null) {
            Snackbar.make(getView(), R.string.donation_cancelled, Snackbar.LENGTH_SHORT).show();
        }
    } else {
        // Handle any other error codes.
        if(getView() != null) {
            Snackbar.make(getView(), R.string.donation_cancelled, Snackbar.LENGTH_SHORT).show();
        }
    }
}
 
開發者ID:systemallica,項目名稱:ValenBisi,代碼行數:30,代碼來源:DonateFragment.java

示例5: onDestroy

import com.google.android.gms.ads.AdView; //導入方法依賴的package包/類
public void onDestroy() {
    for (AdView adView : adViewList) {
        adView.destroy();
    }

    compositeDisposable.clear();
}
 
開發者ID:florent37,項目名稱:OCiney,代碼行數:8,代碼來源:AdsManager.java


注:本文中的com.google.android.gms.ads.AdView.destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。