I am trying to display a big/expanded Custom Notification on Android API 23 but the action buttons don't show.
Bellow you can find my code. I also tried adding actions, but I was not successful.
I also tried other answers from other questions but they didn't work.
Here is my code:
Notification.Builder mBuilder =
new Notification.Builder(this)
.setSmallIcon(R.drawable.mailunread)
.setContentTitle("My notification")
.setContentText("Hello World!").setWhen(0);
Notification notification = mBuilder.build();
RemoteViews contentView=new RemoteViews(this.getPackageName(), R.layout.cell_notification);
notification.bigContentView = contentView;
NotificationManager mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(1, notification);
And here is my view:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="New offer for search" android:textColor="@android:color/black" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="vendor" android:textColor="@android:color/black" />
<ImageView
android:layout_width="100dp" android:layout_gravity="center"
android:layout_height="wrap_content" android:src="@drawable/iphone1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="elevator pitch" android:textColor="@android:color/black" />
<Button
android:id="@+id/buttonNotification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Respond Now"
android:textColor="@android:color/black"
android:layout_weight="20"/>
</LinearLayout>