Skip to content

Commit

Permalink
fix Postcard addFlags bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wuxiaodong committed Apr 3, 2020
1 parent 6909860 commit 8bb3d46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class Postcard extends RouteMeta {
private Uri uri;
private Object tag; // A tag prepare for some thing wrong.
private Bundle mBundle; // Data to transform
private int flags = -1; // Flags of route
private int flags = 0; // Flags of route
private int timeout = 300; // Navigation timeout, TimeUnit.Second
private IProvider provider; // It will be set value, if this postcard was provider.
private boolean greenChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private Object _navigation(final Context context, final Postcard postcard, final

// Set flags.
int flags = postcard.getFlags();
if (-1 != flags) {
if (0 != flags) {
intent.setFlags(flags);
} else if (!(currentContext instanceof Activity)) { // Non activity, need less one flag.
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Expand Down

0 comments on commit 8bb3d46

Please sign in to comment.