Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
Using the example code I'm tyring to add a custom layout for notification,
but nothing shows up. Can anyone help me out?



RemoteViews contentView = new RemoteViews(getPackageName(),
 R.layout.mynotification);
 contentView.setImageViewResource(R.id.image, R.drawable.icon);
 contentView.setTextViewText(R.id.title, "Custom notification");
 contentView.setTextViewText(R.id.text,
 "This is a custom layout");
 Notification notification = new Notification();
 notification.contentView = contentView;
 Intent notificationIntent = new Intent(this, MusicDroid.class);
 PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
 notificationIntent, 0);
 notification.contentIntent = contentIntent;
 mNotificationManager.notify(notificationId, notification);

and the mynotificaiton.xml layout is like this:


http://schemas.android.com/apk/res/android";
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp" >






Thanks for your time.
KK


On Tue, Oct 25, 2011 at 3:12 PM, KK  wrote:

> thanks, got it. let me add the url for others reference
>
> http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomExpandedView
>
> --kk
>
>
> On Tue, Oct 25, 2011 at 2:38 PM, Zsolt Vasvari  wrote:
>
>> I don't have any sample code.  That's what the Android Samples are
>> for.  I am sure there is one that uses a custom layout.
>>
>> On Oct 25, 5:04 pm, KK  wrote:
>> > Hi Vasvari,
>> > Thanks for your answer. I got the point that we've to use custom layout,
>> but
>> > dont know how do I hookup the custom layout to the notification event,
>> would
>> > appreciate if you can point me to some sample code.
>> >
>> > Thanks,
>> > KK
>> >
>> >
>> >
>> > On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari 
>> wrote:
>> > > Create your own Notification layout and set ellipsize to end.
>> >
>> > > On Oct 25, 4:42 pm, KK  wrote:
>> > > > Hi All,
>> > > > Can someone tell me if its possible to move/scroll the notification
>> > > message
>> > > > from one direction to the other(say from right to left). If yes,
>> then how
>> > > to
>> > > > achieve the same ?
>> > > > Actually as part of my media player, I want to show current song
>> title
>> > > > through notification and as the space is small, I want to make it
>> scroll
>> > > so
>> > > > that the enduser can see the full text being displayed through
>> > > > notification.
>> > > > Thanks for your time.
>> >
>> > > > Regards,
>> > > > KK
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> > > Groups "Android Developers" group.
>> > > To post to this group, send email to
>> android-developers@googlegroups.com
>> > > To unsubscribe from this group, send email to
>> > > android-developers+unsubscr...@googlegroups.com
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted
>> text -
>> >
>> > - Show quoted text -
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
thanks, got it. let me add the url for others reference
http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomExpandedView

--kk

On Tue, Oct 25, 2011 at 2:38 PM, Zsolt Vasvari  wrote:

> I don't have any sample code.  That's what the Android Samples are
> for.  I am sure there is one that uses a custom layout.
>
> On Oct 25, 5:04 pm, KK  wrote:
> > Hi Vasvari,
> > Thanks for your answer. I got the point that we've to use custom layout,
> but
> > dont know how do I hookup the custom layout to the notification event,
> would
> > appreciate if you can point me to some sample code.
> >
> > Thanks,
> > KK
> >
> >
> >
> > On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari 
> wrote:
> > > Create your own Notification layout and set ellipsize to end.
> >
> > > On Oct 25, 4:42 pm, KK  wrote:
> > > > Hi All,
> > > > Can someone tell me if its possible to move/scroll the notification
> > > message
> > > > from one direction to the other(say from right to left). If yes, then
> how
> > > to
> > > > achieve the same ?
> > > > Actually as part of my media player, I want to show current song
> title
> > > > through notification and as the space is small, I want to make it
> scroll
> > > so
> > > > that the enduser can see the full text being displayed through
> > > > notification.
> > > > Thanks for your time.
> >
> > > > Regards,
> > > > KK
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted
> text -
> >
> > - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
Just to add one more info, that I'm running this app on API 8/Android 2.2

Thanks,
KK

On Tue, Oct 25, 2011 at 2:34 PM, KK  wrote:

> Hi Vasvari,
> Thanks for your answer. I got the point that we've to use custom layout,
> but dont know how do I hookup the custom layout to the notification event,
> would appreciate if you can point me to some sample code.
>
> Thanks,
> KK
>
>
> On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari  wrote:
>
>> Create your own Notification layout and set ellipsize to end.
>>
>> On Oct 25, 4:42 pm, KK  wrote:
>> > Hi All,
>> > Can someone tell me if its possible to move/scroll the notification
>> message
>> > from one direction to the other(say from right to left). If yes, then
>> how to
>> > achieve the same ?
>> > Actually as part of my media player, I want to show current song title
>> > through notification and as the space is small, I want to make it scroll
>> so
>> > that the enduser can see the full text being displayed through
>> > notification.
>> > Thanks for your time.
>> >
>> > Regards,
>> > KK
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
Hi Vasvari,
Thanks for your answer. I got the point that we've to use custom layout, but
dont know how do I hookup the custom layout to the notification event, would
appreciate if you can point me to some sample code.

Thanks,
KK

On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari  wrote:

> Create your own Notification layout and set ellipsize to end.
>
> On Oct 25, 4:42 pm, KK  wrote:
> > Hi All,
> > Can someone tell me if its possible to move/scroll the notification
> message
> > from one direction to the other(say from right to left). If yes, then how
> to
> > achieve the same ?
> > Actually as part of my media player, I want to show current song title
> > through notification and as the space is small, I want to make it scroll
> so
> > that the enduser can see the full text being displayed through
> > notification.
> > Thanks for your time.
> >
> > Regards,
> > KK
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en