通过意图传递的cookie到浏览器意图、浏览器、cookie

由网友(卖萌的小行家)分享简介:我已经保存在android的一个cookie。现在我想将它传递到我的浏览器的意图。看看我现在的code:I have saved a cookie in android. Now I want to pass it into my browser intent. Look at my current code:In...

我已经保存在android的一个cookie。现在我想将它传递到我的浏览器的意图。看看我现在的code:

I have saved a cookie in android. Now I want to pass it into my browser intent. Look at my current code:

Intent browser = new Intent("android.intent.action.VIEW",
                            Uri.parse("http://mypage.php/memberpagethatrequireacookie.php"));
//putExtra cannot take these arguments -> browser.putExtra("org.apache.http.cookie.Cookie", cookie);
startActivity(browser);

我希望它暂时存放在我的浏览器,所以我的会员页面加载成功。 我的cookie被成功地从HTTP请求中创建和我分配到一个名单,其中,饼干>饼干; 告诉我,如果我提供一些更多的code。

I want it to store temporarily in my browser so my member page loads successfully. My cookie are successfully created from the HTTP request and I assign it to a List<Cookie> cookie; Tell me if I should provide some more code.

任何想法?在此先感谢!

Any ideas? Thanks in advance!

推荐答案

该浏览器没有记载意图演员,更何况一个会允许你注入一个cookie。当然,用户可能会使用不同的浏览器。

The Browser has no documented Intent extras, let alone one that would allow you to inject a cookie. And, of course, the user might be using a different browser.

欢迎您使用的WebView 在应用程序中,你可以使用 CookieManager 来您的cookie注入在的WebView 的环境。

You are welcome to use WebView in your application, and you can use the CookieManager to inject your cookie into the WebView's environment.

阅读全文

相关推荐

最新文章