Skip to content

Most visited

Recently visited

navigation

Keep

public abstract @interface Keep
implements Annotation

android.support.annotation.Keep


Denotes that the annotated element should not be removed when the code is minified at build time. This is typically used on methods and classes that are accessed only via reflection so a compiler may think that the code is unused.

Example:


  @Keep
  public void foo() {
      ...
  }
 

Summary

Inherited methods

From interface java.lang.annotation.Annotation
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.