I am trying to create custom notification in my android application. I am using following code
Custom layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/custom_notification"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="50dp"
android:layout_height="fill_parent"
android:background="@drawable/notification_background"
android:clickable="true" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/ic_action_test" />
</LinearLayout>
</LinearLayout>
This is how I am creating my notification
RemoteViews contentView = new RemoteViews(activity.getPackageName(), R.layout.notification);
Notification noti = new NotificationCompat.Builder(activity)
.setSmallIcon(R.drawable.ic_launcher)
.build();
noti.contentView = contentView;
// Hide the notification after its selected
noti.flags |= Notification.FLAG_NO_CLEAR;
notificationManager.notify(0, noti);
The notification is created, however it does not cover the full height on the notification bar even though I am using fill_parent for height attribute.
Can anybody tell me what is wrong here?