TangSengDaoDao/TangSengDaoDaoAndroid

个人信息 点击修改姓名 就是闪退报错

Closed this issue · 4 comments

个别用户出现 个人信息 点击修改姓名 就会闪退报错
下面是报错log
2024-10-05 10:36:05.124 6498-6498 AndroidRuntime com.xinbida.tsdd.demo E FATAL EXCEPTION: main
Process: com.xinbida.tsdd.demo, PID: 6498
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xinbida.tsdd.demo/com.chat.uikit.user.UpdateUserInfoActivity}: java.lang.IndexOutOfBoundsException: setSpan (3 ... 3) ends beyond length 2
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IndexOutOfBoundsException: setSpan (3 ... 3) ends beyond length 2
at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1321)
at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:682)
at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:674)
at androidx.emoji2.text.SpannableBuilder.setSpan(SpannableBuilder.java:140)
at android.text.Selection.setSelection(Selection.java:93)
at android.text.Selection.setSelection(Selection.java:77)
at android.text.Selection.setSelection(Selection.java:152)
at android.widget.EditText.setSelection(EditText.java:136)
at com.chat.uikit.user.UpdateUserInfoActivity.initData(UpdateUserInfoActivity.java:140)
at com.chat.base.base.WKBaseActivity.onCreate(WKBaseActivity.java:92)
at android.app.Activity.performCreate(Activity.java:7208)
at android.app.Activity.performCreate(Activity.java:7199)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 

名字里面带有回车特殊符号吗?我试了demo是不允许输入回车的

我搜索了一下 确实有回车 不知道他怎么输入进去的,入库的时候能不能替换一下 回车符

我搜索了一下 确实有回车 不知道他怎么输入进去的,入库的时候能不能替换一下 回车符

可能是多端修改导致的,过滤下就好了