I've got an android widget, that displays a TextView
in a FrameLayout
. The TextView
fills the whole parent layout.
What I want to do, it be able to change at runtime where will the text will appear within the TextView
.
Currently, I'd do it by changing the gravity on the TextView... It even has a setGravity(int)
method, which should work perfectly with a RemoteView (I'm in a widget, remember?).. In theory anyway.
Unfortunately, this comes back with an error. Something about "cannot run setGravity(int)
here" or sth. Will update with the exact error message if needed
I'm using this snippet:
myRemoteView.setInt(R.id.myTextView, "setGravity", myGravity);
Anyone tried this before, and has any ideas?