繁体   English   中英

WebView后退按钮注销用户

[英]WebView back button logs out user

采取的步骤:

1.用户打开应用程序( 〜/ home /这是登录页面)

2.用户登录(现在,URL为〜/ home / profile /

3.用户单击链接(例如〜/ home / profile / photos /

4.用户单击返回(现在URL为〜/ home / profile / ofc)

5.用户再次单击返回(现在URL为〜/ home /,并且用户已注销

我如何确保用户保持登录状态(从〜/ home /重定向到〜/ home / profile /,就像您正在登录一样。似乎没有涉及Cookie。

public void onCreate( Bundle b ) {
    super.onCreate( b );
    ...

    this.webView.getSettings().setAppCacheEnabled( true );
    this.webView.getSettings().setSaveFormData( true );
    this.webView.getSettings().setDomStorageEnabled( true );
    this.webView.getSettings().setJavaScriptEnabled( true );
    this.webView.loadUrl( URL );
}

webView.clearHistory(); 当用户登录时(到达2 ),并且如果用户尝试进一步退回,则出现一个对话框,询问用户是否要退出应用程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM