From the 25th of june two unrelated apps that are using ads started to have this NPE
java.lang.NullPointerException
at zo.a(SourceFile:172)
at aeh.a(SourceF
I have find temporary semi-solution. I use thiagolr advice above with delayed ad request:
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
super.handleMessage(msg);
}
};
if (handler != null) {
handler.sendEmptyMessageDelayed(0, 200);
}
Also I removed onResume and onPause methods, so I don't know which solution helps me, but beforee this workaround I had 100-130 java.lang.NullPointerException at zo.a(SourceFile:172) per day. After this workaround I had 6-10 NullPointerException per day. If you want you could try this solutions separately to define which of them helps.
My removed methods in activity:
// @Override
// public void onPause() {
// adView.pause();
// super.onPause();
// }
//
// @Override
// public void onResume() {
// super.onResume();
// adView.resume();
// }