Skip to content
tylertreat edited this page Dec 31, 2012 · 1 revision

The InjectResource annotation is used to indicate that the annotated field is to be injected with an Android resource.

The value attribute corresponds to the ID of the resource to inject.

InjectResource Example

public class MyActivity extends InfinitumActivity {

    @InjectResource(R.string.my_string)
    private String mMyString;

    @InjectResource(R.array.my_array)
    private String[] mMyArray;

    @InjectResource(R.drawable.my_drawable)
    private Drawable mMyDrawable;

    // ...

}

Clone this wiki locally