It seems to be an SDK bug: if AdParam.Bulder
keywords are used it requires some other fields too.
I've compared my code with example and found the difference, i've passed ad request keywords:
private AdParam requestAd(boolean addKeywords) {
AdParam.Builder builder = new AdParam.Builder();
// --- cut start ---
if (addKeywords) {
String[] keywords = context.getResources().getStringArray(R.array.ad_keywords);
for (String eachKeyword : keywords) {
builder.addKeyword(eachKeyword);
}
}
// --- cut stop ---
return builder.build();
}
If i specify the sex (builder.setGender(1);
) - it does not help.
Don't set keywords to workaround it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…