在使用三星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);
}}
这是代码,这是一个例外,只发生在三星s8或更高版本的/*上
发布于 2018-10-28 16:12:23
我已经解决了清单中的测验答案我指定了一个客户网络安全配置android:networkSecurityConfig="@xml/network_security_config",,方法是在清单中删除以下语句,这意味着使用默认配置
https://stackoverflow.com/questions/53024884
复制相似问题