I have a class which extends FragmentActivity
. I want to use getWindowManager().getDefaultDisplay().getMetrics(metrics);
to get screen width and height
But getWindowManager
gives an error invalid method declaration , return type required
I have a class which extends FragmentActivity
. I want to use getWindowManager().getDefaultDisplay().getMetrics(metrics);
to get screen width and height
But getWindowManager
gives an error invalid method declaration , return type required
you have to use this method.It will work properly getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);