[英]volley exception file to parse xml configuration fro network security configuration on android version 7
使用Samsung galaxy s8后,每次我对排球发出请求时,我都一直发现此问题,但我似乎找不到解决方法。 请帮忙。
public void checkverification(View view){
pin=pinView.getText().toString();
PhoneNumber phoneNumber=new PhoneNumber();
String urldata=phoneNumber.getUrl();
String url="http://"+urldata+"/bodapap/selectData.php";
// String url="http://192.168.43.194/bodapap/selectData.php";
StringRequest stringRequest=new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
Toast.makeText(VerificationPage.this,"here",Toast.LENGTH_LONG);
JSONObject object=new JSONObject(response);
JSONArray jsonArray=object.getJSONArray("verification");
for(int i=0;i<jsonArray.length();i++){
JSONObject heroObject=jsonArray.getJSONObject(i);
Hero hero=new Hero(heroObject.getString("verification"));
Toast.makeText(VerificationPage.this,hero.toString(),Toast.LENGTH_LONG);
if(pin.equals(hero.getVerification())){
PhoneNumber phoneNumber=new PhoneNumber(phone);
Intent intent=new Intent(VerificationPage.this,userRegistration.class);
intent.putExtra("phone",phone);
startActivity(intent);
}else {
respondData.setText("Wrong input, pin do not match");
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
datatext.setText(error.getMessage());
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> parameters = new HashMap<String, String>();
parameters.put("phone", phone);
return parameters;
}};
MySingleton.getInstance(getApplicationContext()).addToRequestQueue(stringRequest);
}}
/ *这是代码,这是一个例外,仅在Samsung s8和更高版本的android上发生
我已解决清单中的测验答案,已通过在清单中删除此语句(使用默认有效)来指定客户网络安全配置android:networkSecurityConfig =“ @ xml / network_security_config”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.