Semen Matusovskiy Well-Known Member Licensed User May 15, 2018 #1 Hi, guys -- I noticed that Google Console reports errors for Android 5/6 devices and success for Android 7/8. This is strange as it is, because I don't see troubles in native phones and emulators. But more strange is a text of message. SpannableStringBuilder.java is not my form (maybe from libraries ?) Because is clear from video that Console checks first page only (login), I thought that a problem is somehow relative to csbuilder. So I commented all csbuilder variables and checked my own SubString. No effect. Any ideas ? Code: FATAL EXCEPTION: main Process: com.quick.men, PID: 11948 java.lang.IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 2 at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1096) at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:671) at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:664) at android.text.Selection.setSelection(Selection.java:76) at android.text.Selection.setSelection(Selection.java:87) at android.widget.EditText.setSelection(EditText.java:98) at android.widget.EditText.performAccessibilityActionInternal(EditText.java:138) at android.view.View.performAccessibilityAction(View.java:8892) at android.view.AccessibilityInteractionController.performAccessibilityActionUiThread(AccessibilityInteractionController.java:668) at android.view.AccessibilityInteractionController.-wrap6(AccessibilityInteractionController.java) at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1194) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5459) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) PS. I found interesting discussion -- https://github.com/flutter/flutter/issues/11041 . I really use SelStart for EditText and in some cases I set "cursor" after the last character (means outside the text). If my diagnostic is correct, the solution is simple. In Java it looks so Code: if (selStart >= 0 && selStart <= mEditable.length() && selEnd >= 0 && selEnd <= mEditable.length()) { Selection.setSelection(mEditable, selStart, selEnd); } else { Selection.removeSelection(mEditable); } Alone, what I don't know is "removeSelection" equalent in B4A. Last edited: May 16, 2018
Hi, guys -- I noticed that Google Console reports errors for Android 5/6 devices and success for Android 7/8. This is strange as it is, because I don't see troubles in native phones and emulators. But more strange is a text of message. SpannableStringBuilder.java is not my form (maybe from libraries ?) Because is clear from video that Console checks first page only (login), I thought that a problem is somehow relative to csbuilder. So I commented all csbuilder variables and checked my own SubString. No effect. Any ideas ? Code: FATAL EXCEPTION: main Process: com.quick.men, PID: 11948 java.lang.IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 2 at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1096) at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:671) at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:664) at android.text.Selection.setSelection(Selection.java:76) at android.text.Selection.setSelection(Selection.java:87) at android.widget.EditText.setSelection(EditText.java:98) at android.widget.EditText.performAccessibilityActionInternal(EditText.java:138) at android.view.View.performAccessibilityAction(View.java:8892) at android.view.AccessibilityInteractionController.performAccessibilityActionUiThread(AccessibilityInteractionController.java:668) at android.view.AccessibilityInteractionController.-wrap6(AccessibilityInteractionController.java) at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1194) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5459) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) PS. I found interesting discussion -- https://github.com/flutter/flutter/issues/11041 . I really use SelStart for EditText and in some cases I set "cursor" after the last character (means outside the text). If my diagnostic is correct, the solution is simple. In Java it looks so Code: if (selStart >= 0 && selStart <= mEditable.length() && selEnd >= 0 && selEnd <= mEditable.length()) { Selection.setSelection(mEditable, selStart, selEnd); } else { Selection.removeSelection(mEditable); } Alone, what I don't know is "removeSelection" equalent in B4A.
Erel B4X founder Staff member Licensed User Longtime User May 16, 2018 #2 Can you post the code that sets the selection? Upvote 0
Semen Matusovskiy Well-Known Member Licensed User May 16, 2018 #3 I made some experiments with setSelection. Removing setSelection in basic program doesn't help. What's interesting - if to compile in debug mode, Google Console shows Ok for all 10 devices. The main problem - is not clear, where to search troubles. Any ideas ? Last edited: May 17, 2018 Upvote 0
I made some experiments with setSelection. Removing setSelection in basic program doesn't help. What's interesting - if to compile in debug mode, Google Console shows Ok for all 10 devices. The main problem - is not clear, where to search troubles. Any ideas ?