android6.0方法弃用
天蓬老师
天蓬老师 2017-04-17 15:03:20
0
4
693

这个方法被弃用了
怎么解决
我在百度上看到是用math来替代 但是Match.sqrt返回的是double类型不能强转成float啊

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(4)
小葫芦

http://stackoverflow.com/questions/32065160/method-floatmath-sqrt-not-found
http://bbs.mob.com/thread-17165-1-1.html
Answer Everyone said it should be changed to:

(float)Math.sqrt(...)
洪涛

Give me a solution that is not particularly good, but can solve the problem:

Double.valueOf(Math.sqrt(4.0)).floatValue();
巴扎黑

You select the deprecated method and press F3 to see what the deprecated method is replaced with

小葫芦

Although it is not completely related, but also mention it
https://github.com/android-cn/android-discuss/issues/291

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template