The text content is just too long to be displayed in the notification and it is cut. What can I do? Please help.
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.
If you want a horizontal scrollable text in your app, use android:ellipsize="marquee" where a single line large text will be scrolling.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With