I have 2 remoteViews
- for the notification content
- for the notification ticker (this wont work I think)
I have not included the code for 2. Once I get the content working, I’ll try 2.
Code below
Intent intent = new Intent(this, HomeScreen.class);
PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);
RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.pickupnotification);
RelativeLayout pickupNotificationLayout = (RelativeLayout)this.getLayoutInflater().inflate(R.layout.pickupnotification, null) ;
TextView title = (TextView)pickupNotificationLayout.findViewById(R.id.title) ;
TextView countDown = (TextView)pickupNotificationLayout.findViewById(R.id.countDown) ;
TextView from = (TextView) pickupNotificationLayout.findViewById(R.id.from) ;
TextView to = (TextView) pickupNotificationLayout.findViewById(R.id.to) ;
contentView.apply(this, pickupNotificationLayout);
title.setText("Siddharth" + "2km -> 20km");
countDown.setText("-1:29") ;
from.setText("FROM 2:00pm 14th Jan 2013, Some address") ;
to.setText("TO 4:00pm 14th Jan 2013 Some address") ;
Notification noti = new NotificationCompat.Builder(this).setContent(contentView)
.setSmallIcon(R.drawable.notification_logo)
.setContentIntent(pIntent)
.build();
NotificationManager notificationManager =
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
noti.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(0, noti);

You shouldn’t have to inflate all your views like that multiple times, and I believe where you think the text is being placed and where the framework thinks the text is being placed are not the same. Your code to fill in the content should probably look more like this, using the methods available on
RemoteViews.Obviously, you’ll want to do a similar pattern with the ticker view as well.