如何将用户输入作为印地文文本转换为EditText并发布到服务器

时间:2016-12-30 07:42:39

标签: android

我通过EditText将用户输入发布到服务器。

使用英文文本正常工作,但是当我想将印地文文本发送到服务器时。

服务器中显示空白

所以请帮帮我

已编辑的代码视图.........

 private void login(String taglogin,String LoginEmail,String LoginPassword) {
    class LoginUser extends AsyncTask<String, Void, String> {
        ProgressDialog loading;
        RegisterUserClass ruc = new RegisterUserClass();
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            loading = ProgressDialog.show(getActivity(), "Please Wait",null, true, true);
        }
        @Override
        protected void onPostExecute(String s) {
            super.onPostExecute(s);
            loading.dismiss();
             //Toast.makeText(getActivity(),"onPostExecute   login"+s,Toast.LENGTH_LONG).show();
            Log.d("login",s);


            try {
                JSONObject json = new JSONObject(s);
                Status = json.getString("status");
                UserId=json.getString("user_id");
                Username = json.getString("name");
                UserConatct=json.getString("mobile");
                UserEmailemail=json.getString("email");


                if (Status.equals("true")) {
                    Toast.makeText(getActivity(), "SucessFully Logged in", Toast.LENGTH_LONG).show();
                    SharedPreferences.Editor editor = RegistrationFragment.this.sphref.edit();
                    editor.putString("UserId", UserId);
                    editor.putString("UserName", Username);
                    editor.putString("UserConatct", UserConatct);
                    editor.putString("UserEmailemail", UserEmailemail);
                    editor.putBoolean("login", true);
                    editor.commit();

                    Fragment fr=new BookingFragment();
                    FragmentManager fm=getActivity().getSupportFragmentManager();
                    FragmentTransaction fragmentTransaction1 = fm.beginTransaction();
                    fragmentTransaction1.replace(R.id.containerView, fr);
                    fragmentTransaction1.commit();

                } else {
                    Toast.makeText(getActivity(), "Something gone wrong, Try again", Toast.LENGTH_LONG).show();
                }

            }catch (Exception e){
                e.printStackTrace();
            }
        }
        @Override
        protected String doInBackground(String... params) {
            HashMap<String, String> data = new HashMap<String,String>();


            data.put("tag",params[0]);
            data.put("email",params[1]);
            data.put("password",params[2]);
            String result = ruc.sendPostRequest(LOGIN_URL,data);
            return  result;
        }
    }
    LoginUser ru = new LoginUser();
    ru.execute(taglogin,LoginEmail,LoginPassword);
}

0 个答案:

没有答案