我的数据库中的问号是齐射

时间:2017-12-11 16:57:16

标签: android android-volley

旧设备出现问题,当使用西班牙语或葡萄牙语的旧设备api 15 + 16 + 17将数据发送到服务器时,会出现问号,新设备没有问题

txt_ok.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(edit_post.length() > 0)
                {
                    txt_ok.setVisibility(View.GONE);
                    pd_newpostloading.setVisibility(View.VISIBLE);

                    String url = Information.URL_AddPendingPosts + Information.userid + "&authorname=" + Information.username + "&message=" + edit_post.getText().toString() + "&type=" + edit_category.getText().toString() + "&date=" + nowAsString;

                    try {
                        encodedValue = URLEncoder.encode(url,"UTF-8");
                    } catch (UnsupportedEncodingException e) {
                        e.printStackTrace();
                    }

                    RequestQueue requestQueue = Volley.newRequestQueue(ShowMessages.this);
                    StringRequest stringRequest = new StringRequest(Request.Method.GET, encodedValue, new Response.Listener<String>() {
                        @Override
                        public void onResponse(String response) {
                            txt_ok.setVisibility(View.VISIBLE);
                            pd_newpostloading.setVisibility(View.GONE);
                            Toast.makeText(ShowMessages.this, "Done", Toast.LENGTH_SHORT).show();
                        }
                    }, new Response.ErrorListener() {
                        @Override
                        public void onErrorResponse(VolleyError error) {
                            txt_ok.setVisibility(View.VISIBLE);
                            pd_newpostloading.setVisibility(View.GONE);
                            Toast.makeText(ShowMessages.this, "Failed", Toast.LENGTH_SHORT).show();
                        }
                    });
                    requestQueue.add(stringRequest);
                }
                else
                {
                    Toast.makeText(ShowMessages.this, "Empty", Toast.LENGTH_SHORT).show();
                }
            }
        });

我希望事先得到一些帮助:)

0 个答案:

没有答案