Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Display.getRotation() and Display.getOrientation() apart from the fact that Display.getOrientation() is deprecated?

What is the difference between Display.getRotation() and Display.getOrientation() apart from the fact that it Display.getOrientation() is deprecated?

Do both return an int equal to one of Surface.ROTATION_0, Surface.ROTATION_90, Surface.ROTATION_180, Surface.ROTATION_270?

like image 673
Gallal Avatar asked Jun 20 '11 22:06

Gallal


2 Answers

getRotation() just calls the deprecated method getOrientation(), check the source code of class Display. So it seems to have been deprecated merely for a better name.

like image 119
devconsole Avatar answered Oct 04 '22 06:10

devconsole


The two methods are exactly the same, getRotation() simply calls getOrientation(). For this reason, I am using getOrientation() in my app in order to add support for lower Android levels. I see no reason to limit my ability to distribute my app simply so it can have a different method name. Thus, I completely agree with jap1968.

like image 43
Nik Pardoe Avatar answered Oct 04 '22 04:10

Nik Pardoe