Android排球无法正常运行,我已经使用两种方法来解决此http问题。
清单
android:networkSecurityConfig="@xml/network_security_config"
xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
还有
android:usesCleartextTraffic="true"
答案 0 :(得分:0)
尝试一下:
xml
public void Total (String total){
Log.d("log2","total: " + total);// it prints 30.00
Double number_total = Double.parseDouble(total);
Log.d("log2","number_total: " + total);// it prints 30.0
losing a decimal place.
array_Total.add (number_total); //Arraylist<Double
sum (double) = sum + number_total;
String strSum = (Double.toString(sum));
total.setText (strSum);
}