> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifly.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# WebView

> Control the timers of the WebView that the Notifly Android SDK uses to display in-app popups.

> [tab] Android
>
> The Notifly Android SDK uses a WebView internally to display in-app popups.
>
> On Android, JavaScript in a WebView can continue to run while the app is in the background and consume resources unnecessarily. To control WebView timers, call `pauseTimers()` and `resumeTimers()` at the appropriate points in the Activity lifecycle.
>
> ## 1. Control WebView timers
>
> `pauseTimers()` and `resumeTimers()` affect all WebViews in the app, rather than only the instance on which you call them. If your app has multiple WebViews, these calls can also affect the other WebViews.
>
> ## 2. Behavior before SDK 1.8.0
>
> Before version 1.8.0, the Notifly Android SDK automatically called `pauseTimers()` in the in-app popup Activity's `onPause()` method and `resumeTimers()` in its `onResume()` method.
>
> The following example shows the Activity that displays in-app popups in those versions.
>
> ```kotlin highlight={11, 16} theme={null}
> package tech.notifly.inapp
>
> import android.app.Activity
> // ...
>
> class NotiflyInAppMessageActivity : Activity() {
>     // ...
>
>     override fun onPause() {
>         super.onPause()
>         mNotiflyWebView?.pauseTimers()
>     }
>
>     override fun onResume() {
>         super.onResume()
>         mNotiflyWebView?.resumeTimers()
>     }
>
>     // ...
> }
>
> ```
>
> ## 3. Potential issues and recovery
>
> In versions before 1.8.0, a call to `pauseTimers()` just after an in-app popup closes can also pause other WebViews in the app and stop them from working.
>
> If this happens, call `resumeTimers()` on a WebView instance to resume the timers.
>
> ```kotlin theme={null}
> webView.resumeTimers()
> ```
>
> ## 4. If an in-app popup does not appear
>
> Check that WebView timers are running when the in-app popup should appear. In particular, check that `pauseTimers()` has not left the timers paused.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.