Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add or ignore AdActivity of Admob Ads in Android?
    text
    copied!<p>I have a requirement to add or ignore the <code>AdActivity</code> of the <code>Admob</code> Ads. I am using a <code>TabActivity</code> and the activities navigated inside the tabs are maintained in an <code>ArrayList</code>. After integrating the ads when I navigate to the 3rd activity in a tab and then back press, instead of coming back to the previous activity (which happened before integrating the ads) I'm coming out of the app. While adding the activities to the <code>ArrayList</code> I'm setting the intent flag as <code>FLAG_ACTIVITY_CLEAR_TOP</code>. Could you please tell me how can I overcome coming out of the app on back press in the 3rd <code>activity</code> and instead be able to come to the 2nd <code>activity</code> and then to the 1st <code>activity</code>?</p> <p>Thank you.</p> <p>Edit:</p> <pre><code>04-10 13:19:32.519: E/AndroidRuntime(1392): FATAL EXCEPTION: main 04-10 13:19:32.519: E/AndroidRuntime(1392): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.admob/com.example.admob.activity.MainTabActivity}: java.lang.NullPointerException 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.ActivityThread.access$600(ActivityThread.java:123) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.os.Handler.dispatchMessage(Handler.java:99) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.os.Looper.loop(Looper.java:137) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.ActivityThread.main(ActivityThread.java:4424) 04-10 13:19:32.519: E/AndroidRuntime(1392): at java.lang.reflect.Method.invokeNative(Native Method) 04-10 13:19:32.519: E/AndroidRuntime(1392): at java.lang.reflect.Method.invoke(Method.java:511) 04-10 13:19:32.519: E/AndroidRuntime(1392): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 04-10 13:19:32.519: E/AndroidRuntime(1392): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 04-10 13:19:32.519: E/AndroidRuntime(1392): at dalvik.system.NativeStart.main(Native Method) 04-10 13:19:32.519: E/AndroidRuntime(1392): Caused by: java.lang.NullPointerException 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:101) 04-10 13:19:32.519: E/AndroidRuntime(1392): at com.google.ads.AdView.&lt;init&gt;(SourceFile:87) 04-10 13:19:32.519: E/AndroidRuntime(1392): at com.google.ads.doubleclick.DfpAdView.&lt;init&gt;(SourceFile:27) 04-10 13:19:32.519: E/AndroidRuntime(1392): at com.example.admob.activity.MainTabActivity.onCreate(MainTabActivity.java:80) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.Activity.performCreate(Activity.java:4465) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 04-10 13:19:32.519: E/AndroidRuntime(1392): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 04-10 13:19:32.519: E/AndroidRuntime(1392): ... 11 more </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload