Android的犯规通知时,我做了一个WWW验证 [英] Android doesnt notice when i do an WWW-Authenticate
问题描述
所以我的问题是这样的:
So my problem is the following:
我尝试做登录一个网站,它使用基本身份验证(例如图片:)
I try do login to a website , which uses Basic Authentication (example picture:)
http://i.stack.imgur.com/z1DPt.png
该认证本身的工作原理,并通过我收到HTTPGET预期的输出为String。但是,当我尝试之后访问该网站,使用意图,如:
The Authentication itself works, and i recieve the expected output as String via HTTPGet. But when i try to visit the site afterwards, using an intent like:
Intent browserIntent = new Intent(Intent.ACTION_VIEW,Uri.parse("Some Website"));
handler.startActivity(browserIntent);
我得到上面再次显示,这意味着,我的手机犯规知道它已经被登录窗口。
I get the window above shown again, which means, my phone doesnt know it has already been logged in.
所以,现在是我的问题:如何保存信息,我已经登录到网站?所有我需要做的是,要透过授权头的话,浏览器可以识别它。
So now is my question: How to save the information, that i have been logged in to the website? All i need to do is, to sumbit the Authorization Header so, that the Browser can recognize it.
推荐答案
您需要使用和保存会话Cookie在你的应用程序。这可以通过保存您的验证Cookie的共享preferences.For才能实现看看饼干在开发者页面管理器类
You need to use and save session cookies in your application .This can be achieved by saving your authentication cookies in shared preferences.For implementation look into cookie manager class in the developer page
这篇关于Android的犯规通知时,我做了一个WWW验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!