Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I marquee the text content in Notification?

The text content is just too long to be displayed in the notification and it is cut. What can I do? Please help.

like image 430
Brian 1143 Avatar asked Oct 25 '11 14:10

Brian 1143


People also ask

How to use marquee text in Android?

Navigate to the app > res > layout > activity_main. xml and add the below code to that file. TextView is used here to add the text which we want to display on the screen. Here we have used android:ellipsize=”marquee” to add a marquee to our text and android:singleLine=”true” so that our text will show only in one line.

What is Ellipsize marquee?

If you want a horizontal scrollable text in your app, use android:ellipsize="marquee" where a single line large text will be scrolling.

What is Android Ellipsize?

Android Ellipsize Android TextView ellipsize property Causes words in the text that are longer than the view's width to be ellipsized ( means to shorten text using an ellipsis, i.e. three dots …) instead of broken in the middle to fit it inside the given view.


1 Answers

Try this:

it Works for me, I have tested it.

First Create the Custom Notification :

as Shown here: This Link of the developer site.

After that in TextView of message you want to marquee, put this line:

 android:ellipsize="marquee"

And It Works as you want. Enjoy. Hope it will help you. Thanks.

like image 150
Shreyash Mahajan Avatar answered Nov 01 '22 20:11

Shreyash Mahajan