1234567
1234567

Reputation: 2485

use getWindowManager with FragmentActivity

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

Upvotes: 0

Views: 1713

Answers (1)

kushan
kushan

Reputation: 11

you have to use this method.It will work properly getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);

Upvotes: 1

Related Questions