crash if long click for few time in text

in #utopian-io6 years ago

expected behavior

when users enable the feature reading temporary textshould the user still be able to copy the text that has been in the previous copies without any problem

actual behavior

when the user activates the temporary text reading feature then the user presses long on the text to copy the text several times, the application crashes and stops by itself

how to reproduce

browser ; comfort reader v 1.9.4
device ; android 5.1 idos

github repo

https://github.com/mschlauch/comfortreader

bugs recording

logcats file to help develepor to fixe it

Process: com.mschlauch.comfortreader, PID: 13712
java.lang.StringIndexOutOfBoundsException: length=12; regionStart=25; regionLength=-13
    at java.lang.String.startEndAndLength(String.java:504)
    at java.lang.String.substring(String.java:1333)
    at com.mschlauch.comfortreader.NoteComposer.getExtract(NoteComposer.java:39)
    at com.mschlauch.comfortreader.NoteComposer.getPrefix(NoteComposer.java:110)
    at com.mschlauch.comfortreader.NoteComposer.getcomposedNote(NoteComposer.java:128)
    at com.mschlauch.comfortreader.FullscreenActivity$6.onLongClick(FullscreenActivity.java:296)
    at android.view.View.performLongClick(View.java:4830)
    at android.widget.TextView.performLongClick(TextView.java:8720)
    at android.view.View$CheckForLongPress.run(View.java:19858)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5376)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:947)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)```
Sort:  

Thank you, it has been accepted.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

You got a 3.03% upvote from @emperorofnaps courtesy of @muhammadarif!

Want to promote your posts too? Send 0.05+ SBD or STEEM to @emperorofnaps to receive a share of a full upvote every 2.4 hours...Then go relax and take a nap!

Hey @muhammadarif
Thanks for contributing on Utopian.
We're already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hey! I am @restbot. I've just upvoted and reblogged you!

Please Stop - @restbot

You just said "follow me" and in your your last 100 comments you used 37 phrases considered to be spam and you made this exact same comment 37 times. You've received 0 flags and you may see more on comments like these. These comments are the reason why your Steem Sincerity API classification scores are Spam: 50.06% and Bot: 9.43%

Please stop making comments like this and read the ways to avoid @pleasestop and earn the support of the community.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64386.10
ETH 3142.17
USDT 1.00
SBD 3.98