kobakei/grenade

inject() method

rafakob opened this issue · 2 comments

Hello,
Why not change
DetailActivityIntentBuilder.inject(this, getIntent());
to
DetailActivityIntentBuilder.inject(this);
and insde generated method just call target.getIntent().

getIntent() is available only for activity, not service and broadcastreceiver.
Therefore inject needs Intent arg.

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