Most visited

Recently visited

StringDef

public abstract @interface StringDef
implements Annotation

android.support.annotation.StringDef


表示带注释的String元素表示一个逻辑类型,并且其值应该是明确命名的常量之一。

例:


  @Retention(SOURCE)
  @StringDef({
     POWER_SERVICE,
     WINDOW_SERVICE,
     LAYOUT_INFLATER_SERVICE
  })
  public @interface ServiceName {}
  public static final String POWER_SERVICE = "power";
  public static final String WINDOW_SERVICE = "window";
  public static final String LAYOUT_INFLATER_SERVICE = "layout_inflater";
  ...
  public abstract Object getSystemService(@ServiceName String name);
 

Summary

Inherited methods

From interface java.lang.annotation.Annotation

Hooray!