Too many background threads already running

180 views
Skip to first unread message

Temper Situ

unread,
May 27, 2014, 6:44:41 AM5/27/14
to google-adm...@googlegroups.com
I added PublisherAdView on my listview and activity. It shows "Too many background threads already running. Aborting task. Current pool size: 10" on Samsung Note 3(4.3), but it's work fine on my Nexus4 (4.4.2) with same code. I count there are 9 ad view would be load when on create. 
Adatper code:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
if((position+1)%4==0 && position !=0){
if(convertView instanceof PublisherAdView){
return convertView;
}else{
final PublisherAdView adView=new PublisherAdView(context);
adView.setAdUnitId("My UnitId")); //example
adView.setAdSizes(AdSize.BANNER, new AdSize(320, 50),new AdSize(320, 100),new AdSize(320, 150),new AdSize(320, 200),new AdSize(320, 250),new AdSize(320, 300),new AdSize(320, 350),new AdSize(320, 400),new AdSize(320, 450),new AdSize(320, 500),new AdSize(300, 50),new AdSize(300, 100),new AdSize(300, 150),new AdSize(300, 200),new AdSize(300, 250),new AdSize(300, 300),new AdSize(300, 350),new AdSize(300, 400),new AdSize(300, 450),new AdSize(300, 500));
adView.loadAd(new PublisherAdRequest.Builder().build());
        return adView;
}
}else{
return adapter.getView(position-position/4, convertView, parent);
}
}

There are 2 ad views on my activity. But I set second AdView start to load after first AdView onLoaded. It should not more than 10 threads. I have not idea for this. I will appreciate it if any one has advice. Thx~


DISCLAIMER: This email may contain personal opinion of the sender. It may not constitute formal advice or commitment by the sender or New Media Group. This email and any attachment may contain confidential material. Any unauthorized use or dissemination is prohibited. If you are not the intended recipient, please delete it and notify the sender immediately. Emails are not secure and cannot be guaranteed to be error free.

免責聲明: 此電郵可能只含寄件者個人見解,而非寄件者或新傳媒集團之正式意見或承諾。此電郵及任何附件可能含機密資料,不得進行未經授權之使用及分發。如你並非指定收件者,請立即刪除並通知寄件者。電郵均非完全可靠,難以保證毫無錯誤。

Please consider the environment before printing this e-mail.
Reply all
Reply to author
Forward
0 new messages