Set android shape color programmatically
问题 I am editing to make the question simpler, hoping that helps towards an accurate answer. Say I have the following oval shape: <?xml version=\"1.0\" encoding=\"utf-8\"?> <shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"oval\"> <solid android:angle=\"270\" android:color=\"#FFFF0000\"/> <stroke android:width=\"3dp\" android:color=\"#FFAA0055\"/> </shape> How do I set the color programmatically, from within an activity class? 回答1: Note : Answer has been updated