“shouldOverrIDeUrlLoading”真的被弃用了吗?如果是这样,我可以使用什么呢?
看起来似乎已经弃用了针对Android N的shouldOverrIDeUrlLoading并且我需要使应用程序从API 19开始工作直到最新的AndroID N(测试版),我使用AndroID N中的一些新功能(如Data Saver),所以定位Marshmallow无法解决这个问题,因为我需要使用这些新功能,这是我使用的代码的一部分:
public boolean shouldOverrIDeUrlLoading(WebVIEw webvIEw, String url) { if (url.startsWith("http:") || url.startsWith("https:")) { ... } else if (url.startsWith("sms:")) { ... } ...}
这是AndroID Studio给我的消息:
OverrIDes deprecated method in ‘androID.webkit.WebVIEwClIEnt’
@H_@R_502_6939@_19@
This inspection reports where deprecated code is used in the specifIEd inspection scope.Google says nothing about that deprecation.
我想知道使用@SuppressWarnings(“弃用”)是否会让我在API 19之后使用所有设备,直到最新的AndroID N Beta(以及它发布时的最终版本),我无法自己测试,我从未使用过我需要确定它是否有效,所以,任何人都能说出来?
解决方法:
The version I’m using I think is the good one, since is the exact same as the AndroID Developer Docs, except for the name of the string, they used “vIEw” and I used “webvIEw”, for the rest is the same
@H_@R_502_6939@_19@不它不是.
N Developer PrevIEw的新功能具有以下方法签名:
public boolean shouldOverrIDeUrlLoading(WebVIEw vIEw, WebResourceRequest request)
所有AndroID版本(包括N)支持的版本都具有以下方法签名:
public boolean shouldOverrIDeUrlLoading(WebVIEw vIEw, String url)
So why should I do to make it work on all versions?
@H_@R_502_6939@_19@覆盖不推荐的那个,即将String作为第二个参数的那个.
总结以上是内存溢出为你收集整理的android – 是`shouldOverrideUrlLoading`真的被弃用了吗?我可以用什么呢?全部内容,希望文章能够帮你解决android – 是`shouldOverrideUrlLoading`真的被弃用了吗?我可以用什么呢?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)