정확히 안드로이드 알림을 제공 같은 (제) 레이아웃 인 layout_base_content_notification.xml
을했다.
RemoteViews collapsedViews = new RemoteViews(c.getPackageName(), R.layout.layout_base_content_notification);
Notification noti = builder.build();
noti.contentView = collapsedViews;
다음
나는 customLayout에 포함했다가, layout_big_content_notification.xml
전화 :
<include
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="@layout/layout_base_content_notification" />
을 그리고 bigContentView로 추가 :
RemoteViews expandedViews = new RemoteViews(c.getPackageName(), R.layout.layout_big_content_notification);
noti.bigContentView = expandedViews;
자, 확장 후 bigContentView은 대체 contentView,하지만 그들의 머리글은 동일합니다.
더 나은 해결책이 있다면 알려주십시오.
감사합니다. @Harshit,하지만이 자습서에서는 bigContentView 사용자 정의 예제를 제공하지 않습니다. 기본 스타일이 내 요구 사항과 일치하지 않기 때문에 실제로 그렇게해야합니다. – wverdese
수정 된 답변 확인. –
그게 바로 내가하고있는 것입니다. (실제로 당신이 제공 한 링크는 제가 제 질문에 넣은 것과 같습니다). 문제는 expandViews **가 알림의 기본 contentView를 대체하는 반면 ** 확장 후에 ** 추가하려고합니다. 즉, 화면에 contentView와 bigContentView가 모두 필요합니다. 같은 시간. – wverdese