How to influence linebreak in Android Textview

Posted by Lord Flash on Stack Overflow See other posts from Stack Overflow or by Lord Flash
Published on 2011-11-20T17:48:06Z Indexed on 2011/11/20 17:50 UTC
Read the original article Hit count: 220

I have an Appwidget displaying days until an event like:

eventname (-231 days)

If possible I want to display this String in one line. If the eventname is too long I want to display the full term in braces into a new line. So that it is like:

longeventname
(-231 days)

instead of:

longeventname (-231
days)

(or anything similar)

Is there a way to archive this? Can I make (-231 days) "atomic"?

string.getLength won't work since the size of the widget will vary by device.

© Stack Overflow or respective owner

Related posts about android

Related posts about android-layout