Explain
Indicates whether this View was currently in edit mode. A View is usually in edit mode when displayed within a developer tool. For instance, if the View is being drawn by a visual user interface builder, the This method should return true. Subclasses should check the return value of this method to provide different behaviors if their normal behavior might inte Rfere with the host environment. For Instance:the class spawns a thread in it constructor, the drawing code relies on device-specific features, etc. This method was usually checked in the drawing code of custom widgets.
If you use system-dependent code in the constructor or other drawing-related areas of your custom control, the visual editor will not be able to make an error and prompt you: using View.isineditmode () in your custom views to skip code When shown in Eclipse
Code
public class lockrelativelayout Span style= "color: #0000ff;" >extends Relativelayout { private Handler MainHandler = null ; // public Lockrelativelayout (context context, AttributeSet attrs) { super (context, attrs, 0); Mcontext = context; if (Isineditmode ()) {return Span style= "color: #000000;" >; } mainhandler = (mainactivity) mcontext). Getmhandler (); }}
If you do not add if (Isineditmode ()) {return;}, the code in red will cause visual editing error
I'm the dividing line of the king of the Land Tiger.
Http://stackoverflow.com/questions/15423149/how-to-use-isineditmode-to-see-layout-with-custom-view-in-the-editor
Android--Isineditmode