Code example for Dialog

Methods: setContentView

0
     *               <code>null</code> 
     * @throws IllegalArgumentException if <code>dialog</code> is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void doInjections(Dialog dialog) { 
        Validate.notNull(dialog, "Can't process null dialog"); 
        doInjections(dialog, new VisibleInjectionContext(dialog)); 
    } 
 
    /** 
     * Injects all fields and methods marked by injection annotations in object. 
     * <p> 
     * See full list of injection annotations in javadoc for this class. 
     * </p> 
     * 
     * @param view View view to be processed and that will be used for resolving injections, can't be <code>null</code> 
     * @throws IllegalArgumentException if <code>view</code> is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void doInjections(View view) { 
        Validate.notNull(view, "Can't process null view"); 
        doInjections(view, view); 
    } 
 
    /** 
     * Inject all fields and methods marked by injection annotations in object. 
     * <p> 
     * See full list of injection annotations in javadoc for this class. 
     * </p> 
     * 
     * @param patient Object an object to be processed, can't be <code>null</code> 
     * @param view    View a view to be used for resolving injections, can't be <code>null</code> 
     * @throws IllegalArgumentException if any argument is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void doInjections(Object patient, View view) { 
        Validate.notNull(patient, "Can't inject in null object"); 
        Validate.notNull(view, "Can't process null view"); 
 
        doInjections(patient, new VisibleInjectionContext(view)); 
    } 
 
    /** 
     * Injects all fields and methods marked by injection annotations in object. 
     * <p> 
     * See full list of injection annotations in javadoc for this class. 
     * </p> 
     * 
     * @param patient  Object an object to be processed, can't be <code>null</code> 
     * @param activity Activity activity which content will be used for resolving injections, can't be <code>null</code> 
     * @throws IllegalArgumentException if any argument is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void doInjections(Object patient, Activity activity) { 
        doInjections(patient, new VisibleInjectionContext(activity)); 
    } 
 
    /** 
     * Injects all fields and methods marked by injection annotations in object. 
     * <p> 
     * See full list of injection annotations in javadoc for this class. 
     * </p> 
     * <p/> 
     * Note: this method is applicable only for injection fields in object without any visible presentation (Service, 
     * BroadcastReceiver, etc...), so you can use it only for injecting fields annotated with {@link InjectService}, 
     * {@link InjectSystemService}, {@link InjectResource}, InjectArrayAdapter 
     * 
     * @param patient Object an object to be processed, can't be <code>null</code> 
     * @param context Context android context, can't be <code>null</code> 
     * @throws IllegalArgumentException if any argument is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void doInjections(Object patient, Context context) { 
        doInjections(patient, new InvisibleInjectionContext(context)); 
    } 
 
    /** 
     * Sets content for specified activity and injects all fields and methods marked by injection annotations in object. 
     * <p> 
     * See full list of injection annotations in javadoc for this class. 
     * </p> 
     * 
     * @param activity Activity an activity to be processed and which content will be used for resolving injections, can't be 
     *                 <code>null</code> 
     * @param layoutId int layout id to be inflated 
     * @throws IllegalArgumentException if <code>activity</code> is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void setInjectedContentView(Activity activity, int layoutId) { 
        activity.setContentView(layoutId); 
        doInjections(activity); 
    } 
 
    /** 
     * Sets content for specified activity and injects all fields and methods marked by injection annotations in object. 
     * <p> 
     * See full list of injection annotations in javadoc for this class. 
     * </p> 
     * 
     * @param activity    Activity an activity to be processed and which content will be used for resolving injections, can't be 
     *                    <code>null</code> 
     * @param contentView View view to be inflated 
     * @throws IllegalArgumentException if any argument is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void setInjectedContentView(Activity activity, View contentView) { 
        activity.setContentView(contentView); 
        doInjections(activity); 
    } 
 
    /** 
     * Sets content for specified dialog and injects all fields and methods marked by injection annotations in object. 
     * <p> 
     * See full list of injection annotations in javadoc for this class. 
     * </p> 
     * 
     * @param dialog   Dialog a dialog to be processed and which content will be used for resolving injections, can't be 
     *                 <code>null</code> 
     * @param layoutId int layout id to be inflated 
     * @throws IllegalArgumentException if <code>dialog</code> is <code>null</code> 
     * @throws InflateException         if any injection error has occured 
     */ 
    public static void setInjectedContentView(Dialog dialog, int layoutId) { 
        dialog.setContentView(layoutId); 
        doInjections(dialog); 
    } 
 
    /** 
     * Sets content for specified dialog and injects all fields and methods marked by injection annotations in object.