我有一个 EditText,对于用户在此 editText 中键入的每个字母,我想在 EditText 中的整个文本上应用一个函数,该函数是因为我用阿拉伯语写作,而阿拉伯语字母看起来不好,但是当我使用Farsi class
它时变得很好,我会给你一个简单的例子,如果用户想输入 21,我想应用函数output=3*editText.getText();
,所以当他输入 1 时,我将应用这个函数,所以会出现在 editText 上的结果是:
output = 3*1 = 3
当他输入 2 时,我想显示12*3 = 36
编辑
06-30 12:30:38.547: E/AndroidRuntime(276): FATAL EXCEPTION: main
06-30 12:30:38.547: E/AndroidRuntime(276): java.lang.StackOverflowError
06-30 12:30:38.547: E/AndroidRuntime(276): at android.text.DynamicLayout.reflow(DynamicLayout.java:261)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.text.DynamicLayout.<init>(DynamicLayout.java:150)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.makeNewLayout(TextView.java:4851)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.checkForRelayout(TextView.java:5348)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2688)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2691)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2556)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.EditText.setText(EditText.java:75)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.setText(TextView.java:2531)
06-30 12:30:38.547: E/AndroidRuntime(276): at com.localizedbasedcompetition.AnswerQuestion$3.onTextChanged(AnswerQuestion.java:149)
06-30 12:30:38.547: E/AndroidRuntime(276): at android.widget.TextView.sendOnTextChang