Andorid之Annotation框架初使用(五)

注入res文件夹的资源:

@StringRes

@EActivity
public class MyActivity extends Activity {
  @StringRes(R.string.hello)
  String myHelloString;
  @StringRes
  String hello;
}


@ColorRes

@EActivity
public class MyActivity extends Activity {
  @ColorRes(R.color.backgroundColor)
  int someColor;
  @ColorRes
  int backgroundColor;
}


@AnimationRes

@EActivity
public class MyActivity extends Activity {
  @AnimationRes
  Animation fadein;
}


More @xxxRes ,please search https://github.com/excilys/androidannotations/wiki/Resources#stringres




转载于:https://www.cnblogs.com/lee0oo0/p/3149914.html

你可能感兴趣的:(Andorid之Annotation框架初使用(五))