Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8266601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:13:15+00:00 2026-06-08T05:13:15+00:00

I’ve got an interesting (well, to me at least) issue: I have a notification

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:13:17+00:00Added an answer on June 8, 2026 at 5:13 am

    Rewrite

    As we discussed before you want to force the Notifcation’s tickerText to word wrap. One approach is to break the text into lines of the appropriate length and send out a notification for each one:

    public class Example extends Activity {
        public class AlarmReceiver extends BroadcastReceiver {
            @Override
            public void onReceive(Context context, Intent intent) {
                Log.v("Example", "Alarm received");
                sendNotification();
            }
        }
    
        AlarmManager alarmManager;
        NotificationManager notificationManager;
    
        AlarmReceiver alarmReceiver = new AlarmReceiver();
        Notification notification = new Notification(); 
        Intent notificationIntent;
        PendingIntent pendingIntent;
        int tickerIndex = 0;
        List<String> tickerTexts = new ArrayList<String>();
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
            notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    
            // Determine the screen width and density, split tickerText appropriately
            String tickerText = "A tickerText that is long enough to cause a word wrap in portrait.";
            tickerTexts.add(tickerText.substring(0, 35));
            tickerTexts.add(tickerText.substring(35));
    
            notificationIntent = new Intent(this, Example.class);
            pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
    
            notification.flags = Notification.FLAG_ONLY_ALERT_ONCE;
            notification.icon = android.R.drawable.star_on;
    
            sendNotification();
            registerReceiver(alarmReceiver, new IntentFilter("Generic"));
        }
    
        @Override
        protected void onDestroy() {
            unregisterReceiver(alarmReceiver);
            super.onDestroy();
        }
    
        public void sendNotification() {
            Log.v("Example", "Send Notification " + tickerIndex);
    
            notification.tickerText = tickerTexts.get(tickerIndex);
            notification.setLatestEventInfo(this, "Title", "Text " + tickerIndex, pendingIntent);
            notificationManager.cancel(0);
            notificationManager.notify(0, notification);
    
            tickerIndex++;
            if(tickerIndex < tickerTexts.size()) {
                Log.v("Example", "Setting up alarm");
                PendingIntent alarmPending = PendingIntent.getBroadcast(this, 0, new Intent("Generic"), 0);
                alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, alarmPending);
            }
        }
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.