【发布时间】:2018-05-24 04:07:18
【问题描述】:
我曾经将标题添加到意图如下:
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(baseUrl));
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Bundle bundle = new Bundle();
TokenManager manager = TokenManager.getTokenManager();
bundle.putString("Authorization", manager.getAuthorization());
bundle.putString("Content-Type","application/x-www-form-urlencoded");
myIntent.putExtra(Browser.EXTRA_HEADERS, bundle);
mContext.startActivity(myIntent);
但它似乎不适用于最新版本的谷歌浏览器。它忽略标题,因为没有标题,因此我遇到授权问题。 有谁能够帮我? (我需要使用意图而不是 webview)
【问题讨论】:
-
stackoverflow.com/questions/3750361/… 接受的答案应该有效
-
@Xirate 接受的答案是我目前使用的方法(正如您在问题描述中看到的那样),即使它是默认浏览器,它也不适用于最新的 google chrome 浏览器。跨度>
标签: android google-chrome