I have a widget whose xml layout is simple: an ImageView and a TextView.
I can hardcode the rotation of the TextView in the xml by using android:rotation.
However I want to be able to set the rotation of the TextView programmatically. It seems that a View has a setRotation() method, so the TextView will inherit this method, such that a "normal" TextView can be rotated programmatically used this method.
But when the TextView is buried within a RemoteViews, you have to call the methods indirectly, like setTextViewText() and setTextViewTextSize().
And it also seems that you can call the general setFloat(int viewId, String methodName, float value) to set the value of any methodName, so you can set text size also via passing "setTextSize" to setFloat().
OK to the question....
Since there isn't a setTextViewRotation() method in RemoteViews, I figure I need to call that indirectly using setFloat(viewId, "setRotation", value).
But when I try that, my widget just shows a "Problem Loading Widget" message box.
It works with e.g. setFloat(viewId, "setTextSize", value) to change the text size, so I'm on the right track, but it doesn't work for setRotation in the same place in my code.
I'm guessing that it's because setRotation is an inherited method (from View), rather than a method of TextView itself, but it leaves me slightly stuck as to how to rotation my TextView.
Any ideas?
Thanks!