inject() method
rafakob opened this issue · 2 comments
rafakob commented
Hello,
Why not change
DetailActivityIntentBuilder.inject(this, getIntent());
to
DetailActivityIntentBuilder.inject(this);
and insde generated method just call target.getIntent()
.
kobakei commented
getIntent()
is available only for activity, not service and broadcastreceiver.
Therefore inject
needs Intent arg.
rafakob commented
You could add second method:
public static void inject(MainActivity target) {
inject(target, target.getIntent());
}
public static void inject(MainActivity target, Intent intent) {
target.test = Parcels.unwrap(intent.getParcelableExtra("test"));
}
I know that those are just details, but it looks nicer that way :P