Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/375.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
Java 从AutoCompleteTextView中删除字母_Java_Android_Autocompletetextview - Fatal编程技术网

Java 从AutoCompleteTextView中删除字母

Java 从AutoCompleteTextView中删除字母,java,android,autocompletetextview,Java,Android,Autocompletetextview,我使用AutoCompleteTextView作为登录表单。但是我想删除一个角色,如果他在这里 示例:用户登录名为:784589。但是如果我们写!784589,我们删除“!”字符 有可能吗?我找到了一个解决方案: AutoCompleteTextView textView5 = (AutoCompleteTextView) findViewById(R.id.userName); if (textView5.getText().toString().contains("#")

我使用
AutoCompleteTextView
作为
登录表单
。但是我想删除一个
角色,如果他在这里

示例:用户登录名为:784589。但是如果我们写!784589,我们删除“!”字符


有可能吗?

我找到了一个解决方案:

 AutoCompleteTextView textView5 = (AutoCompleteTextView) findViewById(R.id.userName);

        if (textView5.getText().toString().contains("#")) {
            textView5.setError(getResources().getString(R.string.connect_error));
        }
        else{
            (...)
        }

我真的不知道我需要使用什么函数。我只想从AutoCompletetextView中删除一个字符。或者检测我们是否有这个特征