I am writing a home screen widget. Is it possible to add a view, for example. ImageView, in a home screen widget via RemoteViews? I want to dynamically create views for the home screen widget.
Thank.
updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_news);
updateViews.setTextViewText(R.id.widget_title, mTitle);
updateViews.setImageViewBitmap(R.id.widget_picture,
BitmapFactory.decodeByteArray(image, 0, image.length));
My code is similar to above. But when I call updateViews.addView(aView), my IDE did not allow me to do this and give me a compilation error.
source
share