Problems with Adwhirl (Admob + Inmobi + ..)
With AdWhirl I got these Exceptions ...
I couldn't find Wrong on my part ...
Can anyone suggest this ..
FATAL EXCEPTION: main
E/AndroidRuntime( 279): java.lang.NullPointerException
E/AndroidRuntime( 279): at android.webkit.WebView.requestFocus(WebView.java:6081)
E/AndroidRuntime( 279): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime( 279): at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime( 279): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime( 279): at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime( 279): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime( 279): at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime( 279): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime( 279): at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime( 279): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime( 279): at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
E/AndroidRuntime( 279): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
E/AndroidRuntime( 279): at android.view.ViewGroup.requestFocus(ViewGroup.java:1032)
E/AndroidRuntime( 279): at android.view.View.requestFocus(View.java:3556)
E/AndroidRuntime( 279): at android.view.View.requestFocus(View.java:3534)
E/AndroidRuntime( 279): at android.view.ViewRoot.focusableViewAvailable(ViewRoot.java:1611)
E/AndroidRuntime( 279): at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime( 279): at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime( 279): at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime( 279): at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime( 279): at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime( 279): at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:451)
E/AndroidRuntime( 279): at android.view.View.setFlags(View.java:4493)
E/AndroidRuntime( 279): at android.view.View.setVisibility(View.java:3030)
E/AndroidRuntime( 279): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:668)
E/AndroidRuntime( 279): at android.widget.TabHost.setCurrentTab(TabHost.java:323)
E/AndroidRuntime( 279): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:129)
E/AndroidRuntime( 279): at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:453)
E/AndroidRuntime( 279): at android.view.View.performClick(View.java:2408)
E/AndroidRuntime( 279): at android.view.View$PerformClick.run(View.java:8816)
E/AndroidRuntime( 279): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 279): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 279): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 279): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 279): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 279): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 279): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 279): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 279): at dalvik.system.NativeStart.main(Native Method)
source to share
I got the same error in my application since I added this code to my main activity:
@Override
public void onDestroy() {
if (adView != null) {
adView.destroy();
}
super.onDestroy();
}
This exception seems to come from the Admob part. In this discussion, Eric Leichtenschlag of the Admob SDK support team explains that the above code can indeed be overlooked for Android 2.1+:
The call to AdView.destroy () is not that important if you are using Android 2.1+ as I am not sure if there are any known WebView crashes on Android 2.1+ devices. If you don't make this call a really workaround for this error, that's your best short-term bet. We don't want this to be a long term solution. Calling AdView.destroy () allows us to clean up the AdView properly, and it is designed to prevent the WebView from catching these errors, not creating them.
source to share