I am just starting with Android programming and I get an error message in the following code:
DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm);
The first line perfectly matches Eclipse. But on the second line, this tells me that there is no return type getWindowManager. I do not understand this. When I search the Internet about how to use this code, everyone does the same. However, Eclipse gives me an error.
source share