I have a custom View that is extending ImageView (called PieView) and since this is one of the allowed views to be included in RemoteViews, this should theoretically work.
Since there is no PieView
in Android, it cannot be "one of the allowed views to be included in RemoteViews
", and it will not work, in theory or in practice. While ImageView
is allowed, subclasses are not.
How to work around this issue?
Draw your pie to a Bitmap
, perhaps via a Bitmap
-backed Canvas
, and apply the Bitmap
using setImageViewBitmap()
on RemoteViews
. However, bear in mind that the overall RemoteViews
structure needs to be reasonably small (under 1MB), so do not make your bitmap too big.