简体   繁体   English

初始化Airplay(airpush)广告时引发Null指针异常

[英]Null Pointer exception thrown while initializing Airplay(airpush) ads

I am getting NullPointerException while I try to access Airplay (airpush google play version). 我在尝试访问Airplay (Airpush Google Play版本)时遇到NullPointerException when I call airpush.startSmartWallAd(); 当我致电airpush.startSmartWallAd(); ads page shows working and after that a new tab is open of web (in my opinion) and its says 广告页面显示有效,然后打开一个新标签页(我认为),并说

The sdcard is busy.... sdcard忙。

along with force close message of my game: 以及我的游戏的强制关闭消息:

02-28 17:56:32.546: E/AndroidRuntime(9082): FATAL EXCEPTION: main
02-28 17:56:32.546: E/AndroidRuntime(9082): java.lang.NullPointerException
02-28 17:56:32.546: E/AndroidRuntime(9082):     at android.webkit.ZoomManager.onSizeChanged(ZoomManager.java:945)
02-28 17:56:32.546: E/AndroidRuntime(9082):     at android.webkit.WebViewClassic.onSizeChanged(WebViewClassic.java:5587)
02-28 17:56:32.546: E/AndroidRuntime(9082):     at android.webkit.WebView.onSizeChanged(WebView.java:2030)
02-28 17:56:32.546: E/AndroidRuntime(9082):     at android.view.View.setFrame(View.java:13926)
...................

Edit 编辑

Here i am initializing Airplay object. 在这里,我正在初始化Airplay对象。

if(airpush==null) 如果(airpush == null)

airpush=new AirPlay(MainActivity.this, MainActivity.this, true); airpush = new AirPlay(MainActivity.this,MainActivity.this,true);

airpush.startSmartWallAd(); airpush.startSmartWallAd();

And setting permissions in the manifest and have checked the key. 并在清单中设置权限并检查了密钥。 Everything is fine I have implemented AdCallListner as well and control goes inside each function of listener override functions. 一切都很好,我也实现了AdCallListner,控件进入了侦听器覆盖函数的每个函数内。 If i unplugged the cable from pc and now The sdcard busy message is removed and something start downloading but error remains same Force close. 如果我从PC上拔下电缆,现在sdcard忙消息已删除,开始下载某些内容,但错误仍然相同强制关闭。 The error is occuring in their sample code as well. 该示例代码中也发生了错误。

Can you post more code please? 您可以再发布更多代码吗?

From first impression it looks like one of your objects is not initialized. 从第一印象开始,您的对象之一似乎未初始化。 That's what a NullPointerException indicates. 这就是Nul​​lPointerException所指示的。

Look over your code and see if you've failed to initialize an object you're trying to use. 查看您的代码,看看是否无法初始化要使用的对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM