This annotation can be used with classes derived from:

  • android.app.Activity
  • android.app.Application
  • android.app.Fragment
  • android.app.Service
  • android.content.ContentProvider
  • android.support.v4.app.Fragment
  • android.support.v7.widget.RecyclerView.ViewHolder
  • android.view.View
  • io.github.sporklibrary.interfaces.ContextProvider

It can bind:

  • R.dimen.* to Float or float fields
  • R.string.* to String fields
  • R.drawable.* to Drawable fields

You can bind a resource by specifying its id:

private String appName;

Alternatively, you can imply the view id by the field name:

private String app_name;


public class MyActivity extends Activity {

    private String appName;
    private String app_name;
    private float sporkTestDimension;
    private Float spork_test_dimension;
    private Drawable sporkTestDrawable;
    private Drawable spork_test_drawable;

    public void onCreate(Bundle savedInstanceState) {