Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当我在EditText中添加空格时,它会崩溃_Android_Android Layout_Android Intent - Fatal编程技术网

Android 当我在EditText中添加空格时,它会崩溃

Android 当我在EditText中添加空格时,它会崩溃,android,android-layout,android-intent,Android,Android Layout,Android Intent,我将值从活动A传递到活动B,并将值存储在EditText中,因为我需要它是可编辑的。目的是提供可编辑选项,一旦完成的任何更新被更新到数据库,当我在编辑文本框中输入几个字符来编辑文本时,它会接受并运行应用程序,但当我在文本之间插入空格时,例如:name[space]initial,则运行应用程序时崩溃 我看了日志,上面写着非法争论,我不知道是什么引起了问题 在此检索以前活动中的值 rname=getIntent.getExtras.getStringNAME;remail=getIntent.ge

我将值从活动A传递到活动B,并将值存储在EditText中,因为我需要它是可编辑的。目的是提供可编辑选项,一旦完成的任何更新被更新到数据库,当我在编辑文本框中输入几个字符来编辑文本时,它会接受并运行应用程序,但当我在文本之间插入空格时,例如:name[space]initial,则运行应用程序时崩溃

我看了日志,上面写着非法争论,我不知道是什么引起了问题

在此检索以前活动中的值 rname=getIntent.getExtras.getStringNAME;remail=getIntent.getExtras.getStringEMAIL;rphone=getIntent.getExtras.getStringPHONE编号;raddress=getIntent.getExtras.getStringADDRESS;rcity=getIntent.getExtras.getStringCITY;rcityloc=getIntent.getExtras.getStringCITYLOCATION;rqual=getIntent.getExtras.getStringQUALIFICATION;rgender=getIntent.getExtras.getStringGENDER

上述收到的值存储在编辑文本框中,如下所示 ename=EditTextfindViewByIdR.id.namebox;ename.setTextrname,TextView.BufferType.EDITABLE

eemail=EditTextfindViewByIdR.id.emailbox; eemail.setTextremail,TextView.BufferType.NORMAL

            ephone=(EditText)findViewById(R.id.phonebox);
            ephone.setText(rphone,TextView.BufferType.EDITABLE);

            eaddress=(EditText)findViewById(R.id.addressbox);
            eaddress.setText(raddress,TextView.BufferType.EDITABLE);

            ecity=(EditText)findViewById(R.id.citybox);
            ecity.setText(rcity,TextView.BufferType.EDITABLE);

            ecityloc=(EditText)findViewById(R.id.citylocbox);
            ecityloc.setText(rcityloc,TextView.BufferType.EDITABLE);

            equal=(EditText)findViewById(R.id.qualbox);
            equal.setText(rqual,TextView.BufferType.EDITABLE);

            egender=(EditText)findViewById(R.id.genderbox);
                                       gender.setText(rgender,TextView.BufferType.EDITABLE);    
3.编辑(如果存在)已完成,并用以下代码发送到服务器 编辑文本值将转换为字符串,然后发送到服务器

    HttpPost httppost = new HttpPost(UrlPath.Upath+"User_profile_update?sid=" + sid + "&name=" +sname+ "&phone=" + sphone + "&address=" + saddress + "&city=" + scity + "&city_location=" + scityloc + "&qualification=" +squal + "&gender=" +sgender );
日志输出 致命异常:主 java.lang.IllegalArgumentException:位于的查询中存在非法字符 和显示 上面3中提到的post方法url


如果我正确理解了所有这些内容,那么您将尝试使用editText条目和HttpPost来做一些事情。我认为在这个HttpPost之间添加空格会使应用程序崩溃,因为不允许使用空格。尝试将所有空格替换为%20

您可以发布一些相关代码以及实际的日志堆栈跟踪吗?请发布您的代码和堆栈跟踪!这个问题的题目不是。。。好的。你能发布你的源代码吗?这还不够,请发布你的代码…以及你在这里写的日志的剪贴画