# Enforcing Custom View Usage With Android Lint

DevFeed: [Enforcing Custom View Usage With Android Lint](<https://devfeed.tech/articles/enforcing-custom-view-usage-with-android-lint-22805.md>)

Original publisher: [Read original article](<http://androidessence.com/enforce-custom-views-with-lint/>)

Author: Adam McNeilly

Published: 2021-02-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Android Essence](<https://devfeed.tech/sources/android-essence.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [components](<https://devfeed.tech/tags/components.md>), [customization](<https://devfeed.tech/tags/customization.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [lint](<https://devfeed.tech/tags/lint.md>)

## AI overview

This tutorial explains how to write a custom Android lint check that enforces the use of project-specific custom views instead of corresponding Android framework views in layout XML files.

## Source excerpt

Sometimes an Android project will have to implement a custom view that is an extension of an existing Android view. We may do this for style purposes, or to implement additional logic, or any number of customization purposes. This solution brings a new problem for our codebase - how do we enforce that other developers use our custom view, instead of the Android framework view? We can solve this problem by writing our own Android lint check.