Skip to content

Commit

Permalink
修改onLost参数
Browse files Browse the repository at this point in the history
  • Loading branch information
kymjs committed Jan 27, 2024
1 parent cccf793 commit 25ec897
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public void onFound(@NotNull Navigator navigator) {
}

@Override
public void onLost(@NotNull Navigator navigator) {
super.onLost(navigator);
public void onLost(@NotNull Navigator navigator, int requestCode) {
super.onLost(navigator, requestCode);
Toast.makeText(v.getContext(), "丢失页面" + navigator.getUrl(), Toast.LENGTH_SHORT).show();
}

Expand Down Expand Up @@ -197,8 +197,8 @@ public void onFound(@NotNull Navigator navigator) {
}

@Override
public void onLost(@NotNull Navigator navigator) {
super.onLost(navigator);
public void onLost(@NotNull Navigator navigator, int requestCode) {
super.onLost(navigator, requestCode);
Toast.makeText(v.getContext(), "丢失页面" + navigator.getUrl(), Toast.LENGTH_SHORT).show();
}

Expand All @@ -222,8 +222,8 @@ public void onFound(@NotNull Navigator navigator) {
}

@Override
public void onLost(@NotNull Navigator navigator) {
super.onLost(navigator);
public void onLost(@NotNull Navigator navigator, int requestCode) {
super.onLost(navigator, requestCode);
Toast.makeText(v.getContext(), "丢失页面" + navigator.getUrl(), Toast.LENGTH_SHORT).show();
}

Expand Down
2 changes: 1 addition & 1 deletion router/src/main/java/com/therouter/router/Navigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ open class Navigator(var url: String?, val intent: Intent?) {
}
callback.onArrival(this)
} else {
callback.onLost(this)
callback.onLost(this, requestCode)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.therouter.router.Navigator
*/
open class NavigationCallback {
open fun onFound(navigator: Navigator) {}
open fun onLost(navigator: Navigator) {}
open fun onLost(navigator: Navigator, requestCode: Int) {}
open fun onArrival(navigator: Navigator) {}
open fun onActivityCreated(navigator: Navigator, activity: Activity) {}
}

0 comments on commit 25ec897

Please sign in to comment.