I’ve got an interesting (well, to me at least) issue:
I have a notification which I pop up in my app as needed. everything works great on my Galaxy S II (epic touch 4g from sprint, since there are so different models of the S II out there, I feel I need to be specific), and the notification word wraps with no problem – for example:
this is a notification, but it's too long,
so it'll show this second line on it's own.
To my horror, I realized that some android phones did NOT auto word wrap, and in fact simply cut my notification at the end of their screen, so the above message would show up as:
this is a notification, but it's too long,
obviously, this won’t do. so, what can I do to make sure the entire message always shows up?
Rewrite
As we discussed before you want to force the Notifcation’s
tickerTextto word wrap. One approach is to break the text into lines of the appropriate length and send out a notification for each one:However you can see I skipped an integral part of the set up: I assumed the length of the text that would fit, I didn’t calculate it. In order to determine an appropriate break point you need to calculate the screen’s width, the font’s scaled size, and the density. You also would need factor in the fact that “!!!” might be shorter than “www” depending on the font and that the user could switch between landscape and portrait… You could look in the source code to see how a generic Android breaks up the tickerText.
Anyway, forcing a tickerText to word wrap might be more complex than condensing your original String or sending angry letters to the “non-wrapping” phone manufacturers.