I am getting strange results with the following code:
iv = (ImageView) findViewById(R.id.iv);
iv.setImageResource(R.drawable.spinner_white_76);
Note that this will not work if your object has asymmetric padding (for example a left padding of 5px and a right padding of 0px), because padding is considered part of the object. Which means the computed center will be offset.
One solution to this is to use margins instead of padding if you are using padding for layout reasons. As the API says concerning margins: "This space is outside this view's bounds." (ViewGroup.MarginLayoutParams)
This means that margins will not rotate as padding does.