emilsjolander / IntentBuilder

Type safe intent building for services and activities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.addFlags in builder

antonkrasov opened this issue · comments

Hello, it will be nice to have an ability to addFlags via builder, like:

DetailsActivityIntentBuilder(id)
    .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
    .build(this);

Now it's not very comfortable, what we need to do is:

Intent intent = new DetailsActivityIntentBuilder(id).build(this);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

This means that we can't do startActivity(new Builder().build())

P.S. Thanks for library, should save some time and make code much better.

+1

+1

Also, "FLAG_ACTIVITY_CLEAR_TOP" is so common, it might warrant its own builder method as in:

new DetailActivityIntentBuilder("12345")
    .title("MyTitle")
    .clearTop()
    .build(context)

+1