Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android detect if constructor called in design mode?

It is probably well know that eclipse calls a component's constructor when it has to show the component in the XML graphical layout, so it knows how it will look like.

How do I check in a constructor call if the call was made for design time (above case) or for actual runtime?

like image 386
cdbeelala89 Avatar asked Feb 28 '13 19:02

cdbeelala89


1 Answers

I think you're looking for View.isInEditMode()

like image 91
Todd Sjolander Avatar answered Oct 19 '22 22:10

Todd Sjolander