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 6542979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:17:28+00:00 2026-05-25T11:17:28+00:00

I have got a problem with multi line data (data that contains newline \n).

  • 0

I have got a problem with multi line data (data that contains newline \n). These data is beeing encoded for the url call:

collapse_key=<my-collapse_key>&registration_id=<my-registrationd>
&data.text=Line1%0ALine2&data.group=This+is+a+test

I have no problem sending c2dm messages. But when I try to get my string back from the intent, der is no newline sign.

    text = (String) intent.getStringExtra("text");

I guess there has been some decoding of the urlstring inside the C2DM Framework and that removed all special charaters?

It would be nice, if somebody can help me or can confirm my guess.

  • 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-05-25T11:17:29+00:00Added an answer on May 25, 2026 at 11:17 am

    I found another way by modify C2DMReceiver.java as documented custom view for notification bar.

    enter image description here

    protected void sendnotification (String title, String message) {
           String ns = Context.NOTIFICATION_SERVICE;
    
           NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
    
           int icon = R.drawable.icon100;
    
           RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification_layout);
           contentView.setImageViewResource(R.id.image, R.drawable.icon100);
           contentView.setTextViewText(R.id.text, message);
    
           CharSequence tickerText = message;
           long when = System.currentTimeMillis();
    
           Notification notification = new Notification(icon, tickerText, when);
           notification.contentView = contentView;
    
           Intent notificationIntent = new Intent(this, Startup.class);
    
           PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
    
           notification.flags = Notification.FLAG_AUTO_CANCEL;
           notification.contentIntent = contentIntent;
    
           Random randInt = new Random();
           int id = randInt.nextInt(100) - 1;
           mNotificationManager.notify(id, notification);
        }
    

    and create layout custom_notification_layout.xml like this

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:orientation="horizontal"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:padding="3dp"
                  >
        <ImageView android:id="@+id/image"
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_marginRight="10dp"
                  />
        <TextView android:id="@+id/text"
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:textColor="#000"
                  />
    </LinearLayout>
    

    Hope this helps.

    Reference: Android SDK Doc

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

Sidebar

Related Questions

I have got a multi-threaded app that process a very large data file. Works
I have got a performance problem about TextField.htmlText +=msg .And I know that TextField.appendText(msg)
I have a very specific problem here. I have a multi-dimensional array that I
I have got a problem with calling a global function, which takes a pointer
I have got the following problem since the server has safe mode turned on,
I have got a strange problem about in_array recently which I cannot understand. e.g.
I've got a problem where I have a .co.uk domain of which I am
Got a problem with a query I'm trying to write. I have a table
I've got a problem I can't find any solution for. I have a textfile
I've got a problem I'm not sure how best to solve. I have an

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.