is there any way to completely avoid xml, and build the whole layout with java code?
No, sorry. RemoteViews
relies heavily on layout XML resources. While there is an addView()
method, it turns around and adds another RemoteViews
, and that puts you right back where you started from.
can I somehow retrieve a View, like I would use findViewById(int)?
No, because there is no View
in your process. You configure the widgets via the various setter methods on RemoteViews
.