Android EditText truncating after 9k on Gingerbread [duplicate] - android

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?

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!

Related

Will all android devices display the same length app name?

I wonder if all Android devices display the same length app name. I made an app and can see it's full 27 characters name on my Galaxy S4. How will the same name look on older phones/versions of Android? Will they display less characters of the app name than my S4? If so, how many will they display and is there an amount of characters all phones will display?
I don't think the name of the app length has changed with different releases of Android. But different sized devices might struggle more depending on how you're displaying your text. There are a couple threads on this subject.
Here's one: how much long can be a android application name
EDIT: You could test with an emulator on a very old device.

autoLink="all" feature of TextView Android

I am using the autoLink="All" feature of TextView to linkify all urls and telephone numbers in a TextView.
The problem I am facing is that on emulator, certain numbers are identified as phone numbers and are clickable.
On real device, these numbers doesnt get identified as phone numbers and are not clickable.
Say If the TextView contains a number 163111, On emulator it is clickable. Clickng this takes user to dialer.
But on Nexus 7 this number is not clickable.
I had a look at the Linkify.addLinks() method, which I thought would explain this behaviour, but failed to find an explanation.
Has any one faced this problem?
What may be the reason behind this?
try "autolink" property for textview.
android:autoLink="email|phone|web"
Never mind. The emulator was running on 4.2 and Nex 7 was on 4.3
https://android.googlesource.com/platform/frameworks/base/+/430fc97
The modifications in Linkify code was the reason.

Text View is flashing/blinking in my application

We're developing a custom Android application built for a specific Android -- formerly the Samsung Galaxy Tab 2 -- and I was pretty happy with the way it looked.
However, we've changed phones to the Nexus 7, and now a Text View that used to look fine blinks rapidly -- it's seizure inducing. My application updates the text a few times a second, but that's not new and we never had this problem with the Samsung.
Has anybody experienced something similar, or otherwise have a suggestion?? My original suspicion that the Samsung had more processor power is, I'm pretty sure, incorrect. Should I look into some of the Nexus' configuration details concerning rendering the GPU??
It's going to be annoying if have to get rid of this software feature, but I might have to if I can't improve the look.
It's not a great answer, but it does work for me if I set up my code to only update the text view every other trip through the draw loop. If anyone else has a different suggestion I'd certainly prefer to try something else, but this at least works.

Limited edittext on some samsung devices?

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?
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!

Inconsistency in setting html text to Android TextViews and WebViews

I am using Html.fromHtml to setText to my textView. Here is my text.
The figure below is not drawn to scale. Which of the following will most likely to be the value of ∠P?
In this sentence, angle sign is html value ( ).
It is working fine in emulator. I also tested on some android device (some unnamed tablets an ebook readers). They are ok. But in my android phone (Sony Xperia X8), it is not rendering angle sign. Instead, it is showing .
Is there anything wrong? Why is it not being consistent across devices although it is just a textview rendering simple html? More importantly, how could I solve this issue. Following is my graphical representation of my problem.
Edit: It is not only in textviews but also in webviews. I changed using webview instead of textview. Unfortunately, it didn't work out as well. Anyone got any idea?

Categories

Resources