Limited edittext on some samsung devices?

依然范特西╮ 提交于 2019-12-02 12:08:05

问题


I am trying to read a long text from the sdcard to an edittext in Android. On almost all devices this works very well, except for some samsung devices. When I try to read anything over 10kb the string I read it too gets the whole file. When I try to add this to the edittext its cut off at 10kb. Even if I put it in a loop trying to add a little bit at the time with append it still doesn't add more than 10kb.

On every phone I have tried this works, on HTCs, Sony Ericssons, the nexus phones, but none of the Galaxy S... phone can do it.

Has this happened to anyone else? Is there a workaround?


回答1:


10 minutes after posting this question for the 20th time on the web without any answers I find it myself!

In your layout file, in the EditText, add android:maxLength="some high value" and it works!

Interesting that most other devices don't come with a limit while some Samsung phones does for the edittext!



来源:https://stackoverflow.com/questions/10511629/limited-edittext-on-some-samsung-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!