How Do I fix the password/ username authentication in my code?

后端 未结 4 1652
野性不改
野性不改 2020-12-21 20:45

I have an app in which I log in using my username and password and then I switch to a page which contains a webview. The webview recognizes this username and password and lo

相关标签:
4条回答
  • 2020-12-21 21:22

    In my previous project, I have faces some similar problem. I solve there in this approach - instanciate the blank/default layout in onCreate, then load the configuration from sharedPref and set the parameter value for the layout inside onResume. and before leaving the page save the configure changes(if happens) inside onPause. If this looks good to you can check it in your case.

    0 讨论(0)
  • 2020-12-21 21:30

    Ok.

    you have to add the username/password in the onResume instead of OnCreate

    like explain in this Document http://developer.android.com/reference/android/app/Activity.html

    0 讨论(0)
  • 2020-12-21 21:37

    This is the problem of cookie management.

    CASE :~ 1 IF you are visiting other web site (facebook,gmail,etc.) To solve this you have to maintain cookie files which was coming through vebView.

    & send back it to next time new page request.

    CASE :~ 2 if you are visiting your own web site then there is one another problem solution is you can check on server side (in your web site) device info & compare it to that device info which was at login time.

    or you can send hidden data in hidden tag & validate it in your app.

    0 讨论(0)
  • 2020-12-21 21:40

    Move the SharedPref code into onClick and report here...

    0 讨论(0)
提交回复
热议问题