---
updatedAt: 2025-08-27T08:18:52.000Z
agentTools:
  projectIndex: https://developers.taboola.com/taboolasdk/llms.txt
---

# Advanced Options

*Android Web* - Advanced Options

<V4banner />

> ✅ Sample App
>
> While reading the documentation, take a look at our <a href="https://github.com/taboola/android-sdk-examples-4x" target="_blank">Sample App</a>.

# Working with ViewPager

When working with `ViewPager`, make sure to fetch **Taboola** content when the next page is *visible* to the user (not before).

1. For each JS tag in the `<body>` of your web content, add `lazyFetch: true`:

```html
<script type="text/javascript"> 

...
  
_taboola["mobile"].push( {
    lazyFetch: true // If you are using `ViewPager` 
});
</script>
```

2. Because you added a `lazyFetch` directive within the JS tag, you must fetch **Taboola** content *via your Java code*:

```java
@Override
public void onPageSelected() {
    mWebUnit.fetchContent(); // When using `ViewPager`
}
```

> 🚧 ViewPager
>
> If you *prefetch more than 1 page* using ViewPager:
>
> 1. Fetch **Taboola** content when the next page is *visible* to the user - i.e. in the `onPageSelected` method.
> 2. If the `onPageSelected` method is fired more than once, make sure to fetch content *once only*.

# Dark Mode

> 🚧
>
> Dark mode is **not** supported by default. For dark-mode placements, contact your **Taboola Account Manager**.

Once **Taboola** has configured your dark-mode placements, you can use the following code in your application:

```java
// Define a map with extra properties:
HashMap<String, String> extraProperties = new HashMap<String, String>() {{ put("darkMode", "true"); }};

// Set the extra properties within the Unit instance:
tblWebUnit.setUnitExtraProperties(extraProperties);
```

# Opening Audience Exchange (AE) Items in App

If your widget or feed feature AE items and you wish to open these items within the app instead of an external web view, please see the following steps below.

1: Add the extra property `allowAudienceExchangeClickOverride` to Taboola's global properties:

```java
HashMap<String, String> extraProperties = new HashMap<String, String>() {{ put("allowAudienceExchangeClickOverride", "true"); }};
Taboola.setGlobalExtraProperties(extraProperties);
```

2: Override the `onItemClick` Listener to implement your desired behavior:

```java
TBLWebUnit tblWebUnit =
tblWebPage.build(<Context>, <placementName>, <mode>, <placementType>, new TBLWebListener(){
   
    @Override
    public boolean onItemClick(String placementName, String itemId, String clickUrl, boolean isOrganic, @Nullable String customData) {  
         try {
              data = new JSONObject(customData);
              if (data.has("isAudienceExchange") && data.optBoolean("isAudienceExchange", false)) {
                 // Handle Audience Exchange items
                 return false;
               }
            } catch (Exception exception) {
               exception.printStackTrace();
            }
         return true;
  }
});
```