使用nativescript从堆栈中删除Android Activity

时间:2016-08-25 02:54:53

标签: android nativescript angular2-nativescript

这篇文章准确解释了我想要做什么,但我正在寻找有关如何在NativeScript中执行此操作的帮助。

Removing an activity from the history stack

[已解决] 我在这里找到了答案:

https://github.com/NativeScript/nativescript-angular/blob/master/ng-sample/app/examples/router/clear-history-test.ts

1 个答案:

答案 0 :(得分:1)

这是我使用angular和nativescript的代码解决方案:

// Sign In Page
import { RouterExtensions } from "nativescript-angular/router";

constructor(private _router: RouterExtensions) {}

private onSignInComplete(): void {
    this._router.navigate(["/mainPage"], { clearHistory: true });
}