---
title: "Inline campaigns (Android Views)"
id: "views-based"
project: "Contextual Commerce"
url: "https://docs.bazaarvoice.com/articles/contextual-commerce/views-based"
updated: 2026-10-15T09:12:44Z
---

# Inline campaigns \(Android Views\)

Inline campaigns are informational notes that are embedded directly into your application's existing user interface. Unlike pop-ups or overlays, these views reside within your page layout. Initially, they are hidden and have a height of 0 px. When a campaign is triggered, the view expands with an animation to reveal the content, which typically includes a headline and message. The following image shows an example inline campaign.

![Mobile shopping interface showing an inline campaign alert box that reads: Not many left. This item is going fast. Don't miss out!](/resources/Storage/contextual-commerce/jetpack/jetpack-2026-02-18-2.png)

**Note:** The steps in this article apply only to Android Views. For Jetpack Compose inline campaigns, refer to the [Jetpack Compose implementation topic.](/articles/contextual-commerce/jetpack)
 
##  How inline campaigns work

After adding `GranifyInlineView` to your layout and implementing the expand and collapse handlers, the SDK handles the lifecycle automatically:

* **Discovery:** When you call `Granify.trackPageView(...)`, the SDK scans the current activity to identify all available `GranifyInlineView` locations.
* **Matching:** If the server matches the shopper to a campaign, it instructs the SDK to activate the specific targeted view.
* **Expansion:** The SDK initializes the content and animates the view, triggering the `expandHandler` (or `collapseHandler`) on each frame to update your layout dynamically.
* **Persistence:** If a user navigates away from the page, the inline preserves its state and is prepared for redisplay if the user returns.

## Topics in this section

Select a topic to begin your integration:

| Topics | Description |
| --- | --- |
| /articles/contextual-commerce/views-based-inline-campaigns-implementation<br> <br>[Implement inline campaigns](/articles/contextual-commerce/views-based-inline-campaigns-implementation) | Steps to implement inline campaigns using XML layouts and handlers. |
| /articles/contextual-commerce/views-based-inline-campaigns-testing<br> <br>[Test inline campaigns](/articles/contextual-commerce/views-based-inline-campaigns-implementation) | Describes how to validate your integration and troubleshoot layout issues. |

[![Provide feedback button](/resources/Storage/contextual-commerce/bv-global/topic-footer-2026/provide-feedback-button.png)](https://docs.google.com/forms/d/1qGZ5rApqDrXO_j6vNzcDihDAOPMEjmUr1alHvcEIbQU/edit)