excilys/androidannotations — Issue #118: @FromHtml in @EViewGroup generates a compile error
Author: pyricau
Created: 2012-02-25 18:20:47+00:00
State: open
Labels: Defect

Consider the following class :

```java
@EViewGroup(R.layout.help)
public class HelpView extends FrameLayout {

@FromHtml(R.string.about_content)
@ViewById
TextView helpText;

public HelpView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}

public HelpView(Context context, AttributeSet attrs) {
super(context, attrs);
}

public HelpView(Context context) {
super(context);
}

}
```

The generated class contains the following code:

```java
private void afterSetContentView_() {
helpText = ((TextView) findViewById(id.helpText));
if (helpText!= null) {
helpText.setText(Html.fromHtml(getString(string.about_content)));
}
}
```

`getString()` is not implemented in a view, it should be `getContext().getString()` instead.