I have a simple Custom TextView that sets custom font in its constructor like the code below
public class MyTextView extends TextView {
@Inject CustomTy
Looking into the Android source, this problem is described in a little more detail:
requestLayout()
was called during layout. If no layout-request flags are set on the requesting views, there is no problem. If some requests are still pending, then we need to clear those flags and do a full request/measure/layout pass to handle this situation.
It appears that the problem may be related to Roboguice; see issue #88. The suggested solution there is to use @InjectView:
You can now use @InjectView from inside a view class. Just call Injector.injectMembers() after you've populated your view, ala:
public class InjectedView extends FrameLayout { @InjectView(R.id.view1) View v; public InjectedView(Context context) { super(context); final View child = new View(context); child.setId(R.id.view1); addView(child); RoboGuice.getInjector(context).injectMembers(this); } }
Perhaps you should consider migrating RoboGuice.injectMembers(context, this)
to the declaration of your View object using the @InjectView annotation.