API to Destroy NativeAd

107 views
Skip to first unread message

Hermawan Winata

unread,
Sep 3, 2022, 10:59:31 AM9/3/22
to Google Mobile Ads SDK Developers
Hi Google Mobile Ads team,

My use case: NativeAd is showed in a RecyclerView by using NativeAdView. I found on the docs there are 2 destroys (which will be referenced by below questions)


Questions
Q1: Once I no longer need an ad, do I need to call the above 2 destroy methods? In which order?
Q2: In order to save memory when user opens another Activity, I call destroy only on the NativeAdView but not on the NativeAd (let's call it NativeAd1). When that user returns,  I create a new NativeAdView with NativeAd1. Is it okay?  

Regards

usser naame

unread,
Sep 3, 2022, 8:35:36 PM9/3/22
to Hermawan Winata, Google Mobile Ads SDK Developers
تعا

في يوم السبت 3 سبتمبر 2022 ، كتب هرماوان ويناتا <shin...@gmail.com>:
مرحبًا بفريق Google Mobile Ads ،

حالة الاستخدام الخاصة بي: يتم عرض NativeAd في RecyclerView باستخدام NativeAdView. لقد وجدت في المستندات أن هناك محطمين (سيتم الرجوع إليه من خلال الأسئلة أدناه)


الأسئلة
Q1: بمجرد أن لم أعد بحاجة إلى إعلان ، هل أحتاج إلى استدعاء طريقتين إتلاف أعلاه؟ بأي ترتيب؟
Q2: من أجل حفظ الذاكرة عندما يفتح المستخدم نشاطًا آخر ، أقوم باستدعاء التدمير فقط على NativeAdView ولكن ليس على NativeAd (دعنا نسميها NativeAd1). عندما يعود هذا المستخدم ، أقوم بإنشاء NativeAdView جديد باستخدام NativeAd1. هل هو بخير؟  

يعتبر

-

---
لقد تلقيت هذه الرسالة لأنك مشترك في مجموعة "مطوري SDK لإعلانات Google على الجوال" في مجموعات Google.
لإلغاء الاشتراك في هذه المجموعة وإيقاف تلقي رسائل البريد الإلكتروني منها ، أرسل بريدًا إلكترونيًا إلى google-admob-ads-sdk + unsub...@googlegroups.com .
لعرض هذه المناقشة على الويب ، تفضل بزيارة https://groups.google.com/d/ msgid / google-admob-ads-sdk / b523a907-4308-475b-b303- a30f4e30700cn٪ 40googlegroups. كوم .

Mobile Ads SDK Forum Advisor

unread,
Sep 5, 2022, 3:09:22 PM9/5/22
to shin...@gmail.com, google-adm...@googlegroups.com
Hi Hermawan,

Thank you for raising your concern to us. Let me do the best I can to answer them. Kindly refer to my response below.


Q1: Once I no longer need an ad, do I need to call the above 2 destroy methods? In which order?
- Regardless of the order is fine


Q2: In order to save memory when user opens another Activity, I call destroy only on the NativeAdView but not on the NativeAd (let's call it NativeAd1). When that user returns,  I create a new NativeAdView with NativeAd1. Is it okay?  
- Yes, you can create the NativeAdView with NativeAd1 and I can confirm that its implementation is fine base on this use case

Regards,
 
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2dv3sf:ref
Reply all
Reply to author
Forward
0 new messages