在写通知栏的时候遇到如下错误
android.app.RemoteServiceException: Bad notification posted from package com.cootek.smartdialer: Couldn't expand RemoteViews
原因:
使用了自定义控件
<com.makeramen.roundedimageview.RoundedImageView android:src="@drawable/icon_dialer" android:layout_width="32dp" android:layout_height="32dp" android:layout_gravity="center_vertical" android:layout_marginLeft="14dp" />
以及
<View android:layout_width="1px" android:layout_height="24dp" android:layout_gravity="center_vertical" android:background="#d8d8d8" />
因为RemoteViews 支持的控件数量有限
将com.makeramen.roundedimageview.RoundedImageView 改为ImageView
将View 改为TextView
问题解决。