# Android leak pattern: subscriptions in views

DevFeed: [Android leak pattern: subscriptions in views](<https://devfeed.tech/articles/android-leak-pattern-subscriptions-in-views-15503.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/android-leak-pattern-subscriptions-in-views>)

Author: P-Y Ricau

Published: 2016-09-20T00:55:57Z

Content type: tutorial

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [debug](<https://devfeed.tech/topics/debug.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>)

## AI overview

This article explains how subscriptions held by Android views can cause memory leaks when they are not unsubscribed. It examines a case where relying on view attachment and detachment callbacks failed because an inflated view hierarchy was never attached before the activity finished.

## Source excerpt

Avoid memory leaks by properly handling view subscriptions