我正在实现一个客户端库到OAUTH API。在认证过程中,webview客户端会启动并加载认证页面的URL。但是,webview客户端有时可以正确启动,但最近开始导致ANR。Android WebView客户端导致ANR
下面是库中的代码:
public String inflateView(Activity activity,String redirectUrl, String scope){
final String rUrl=redirectUrl;
LayoutInflater inflater = activity.getLayoutInflater();
page=inflater.inflate(R.layout.web_overlay, null);
final String scopes=scope;
activity.setContentView(page);
gWebView = (WebView) page.findViewById(R.id.webview);
gWebView.loadUrl("https://api.23andme.com/authorize/?redirect_uri="
+ redirectUrl + "&response_type=code&client_id=" + this.clientId
+ "&scope=" + scope);
Log.d(TAG, "http://192.241.244.189/auth/authorize?response_type=code&client_id=IV9AMqP9&scope=read:s