Code example for Field

Methods: get, setAccessible

0
			return; 
 
		try { 
			Class<?> textview = Class.forName("android.widget.TextView");
			Field tEditor = textview.getDeclaredField("mEditor");
			tEditor.setAccessible(true);
			Class<?> editor = Class.forName("android.widget.Editor");
			Method privateShowError = editor.getDeclaredMethod("setErrorIcon", Drawable.class);
			privateShowError.setAccessible(true);
			privateShowError.invoke(tEditor.get(this), icon);
		} 
		catch (Exception e) {
			// e.printStackTrace(); // oh well, we tried 
		} 
	} 
}