title: Android Annotations Custom View
body: <p>I am trying to implement Android Annotations to my View. But I cant figure out how to do it correctly. My Problem at the moment is that the fields in the View are always NULL.</p>
  
  <p>I think I have a bit of an understanding problem how to use Android Annotations with Views and Adapters. Can someone give me a hint how I would do this correctly? </p>
  
  <p>In my fragment I use the following adapter:</p>
  
  <p><strong>ItemAdapter</strong></p>
  
  <pre><code>@EBean
  public class ItemAdapter extends BaseAdapter {
  
  public ItemAdapter(Context context) {
      this.context = context;
  }
  
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
      GalleryListView view;
      if (convertView == null) {
          view = GalleryListView_.build(context);
      } else {
          view = (GalleryListView) convertView;
      }
  
      imageUrls = getDocumentListAll();
      DDocuments doc = documentProxy.getElementByDocument(imageUrls.get(position));
      view.init(imageUrls.get(position), Uri.fromFile(new File(doc.getPath())));
  
      // before I used annotations I did set my Image using this. But now I dont really know how to use this line
      // ImageLoader.getInstance().displayImage(Uri.fromFile(new File(doc.getPath())).toString(), holder.image, options, animateFirstListener);
  }
  }
  </code></pre>
  
  <p><strong>GalleryListView</strong></p>
  
  <pre><code>@EViewGroup(R.layout.gallery_list)
  public class GalleryListView extends LinearLayout {
      @ViewById
      ImageView   image;
  
      @ViewById
      TextView    text;
  
      public void init(String imageText, Uri imageUri) {
          text.setText(imageText);
          image.setImageURI(imageUri);
      }
  }
  </code></pre>