Well I do not have a huge amount of text, just 50 characters. And I want at
least, if I cannot put all the text in the notification bar, that when user
click on the notification, intent is launched and an activity start. But as
I am triggering this from contextImpl I do not know how to make the intent
connected to a particular activity, or is there another way to display text
when notif is clicked?

Regards
On Wed, Mar 23, 2011 at 7:58 AM, Dianne Hackborn <[email protected]>wrote:

> Notifications can't be arbitrarily long, to limit how much applications can
> spam the notification system.  If you want a notification with a huge amount
> of text, you are probably not doing things in a good way.  It is hard to say
> more without knowing what you are actually trying to accomplish.
>
>
> On Tue, Mar 22, 2011 at 1:10 AM, Tux <[email protected]> wrote:
>
>> Hi,
>>
>> I have modified ContextImpl for personal purpose, and a notifUser()
>> method has been added, launched in a particular case that does not
>> matter here. This method contains a piece of code to launch a notif:
>>
>>                        String ns = Context.NOTIFICATION_SERVICE;
>>                        NotificationManager mNotificationManager =
>> (NotificationManager)
>> getSystemService(ns);
>>                        int icon = R.drawable.ic_dialog_alert;
>>                        CharSequence tickerText = "Privacy Issue";
>>                        long when = System.currentTimeMillis();
>>                        Notification notification = new
>> Notification(icon, tickerText,
>> when);
>>                        Context context = getApplicationContext();
>>                        CharSequence contentTitle = "Privacy issue";
>>                        Intent notificationIntent = new Intent(this,
>> ContextImpl.class);
>>                        PendingIntent contentIntent =
>> PendingIntent.getActivity(this, 0,
>> notificationIntent, 0);
>>                        notification.setLatestEventInfo(context,
>> contentTitle, contentText,
>> contentIntent);
>>                        final int HELLO_ID = 10;
>>
>>                        mNotificationManager.notify(HELLO_ID,
>> notification);
>>
>> The problem is, the message is truncated in the notification due to
>> its length. I was wondering how can I make a line break in this
>> notification? "\n" is not working. Or maybe, how can I put an activity
>> to launch a toast when notification is clicked, in the notification
>> intent. I tried to call an activity from an upper layer, but this is
>> not working, activity cannot be found (which I understand because I am
>> in a lower layer).
>>
>> Best regards,
>>
>> guillaume
>>
>> --
>> unsubscribe: [email protected]
>> website: http://groups.google.com/group/android-porting
>>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>


-- 
Benats Guillaume. (Computer Sciences, FUNDP, Namur)

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to