roboguice.inject
Annotation Type InjectExtra


@Retention(value=RUNTIME)
@Target(value={FIELD,PARAMETER,METHOD})
public @interface InjectExtra

Indicates that a variable member of a class (whether static or not) should be injected with an Android extra. The value is compulsory, and correspond to the key of the extra.

The extra must exists when the activity is injected, unless you specify optional=true in the InjectExtra annotation. If optional is set to true and no extra is found, no value will be injected in the field.

The default behavior of the InjectExtra annotation is to forbid null values. However, if you wish to allow injection of null values, you should use the Nullable annotation.

You can define a default value in Java when the extra is optional :
{@code

Author:
Mike Burton

Required Element Summary
 String value
           
 
Optional Element Summary
 boolean optional
           
 

Element Detail

value

public abstract String value

optional

public abstract boolean optional
Default:
false


Copyright © 2012. All Rights Reserved.