Friday, February 28, 2014

Asked the little rookie small problem


private Display mDisplay;

public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
mDisplay = mWindowManager.getDefaultDisplay ();

}
Ask phrase in mDisplay = mWindowManager.getDefaultDisplay (); phrase What does it mean prescribed format it? This is how it mwindowmanager<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
mWindowManager is an example of using Context.getSystemService (Context.WINDOW_SERVICE) to a WindowManager's.
WindowManager have a method getDefaultDisplay (), returns an object inherits Display, you can get to the screen resolution and other information.
Reply:
Get the resolution of details to check SDK, see the SDK files to loneliness, you can solve most of the problems
Reply:
reference to the second floor winteror reply:
get resolution, details to check SDK, see the SDK files to loneliness, you can solve most of the problem

See the official android SDK, what way?
Reply:
reference to the third floor a394268045 reply:
Quote: references to the second floor winteror reply:

Get the resolution of details to check SDK, see the SDK files to loneliness, you can solve most of the problems

See the official android SDK, what method do?

http://developer.android.com/reference/packages.html
Reply:
The first question:
mDisplay = mWindowManager.getDefaultDisplay () returns a Display object, mainly for some of the parameters on the screen,
 DisplayMetrics metrics; 
mDisplay.getMetrics (metrics);

After so many calls after can get pixel screen, the device pixel density equivalent.

The second question:
mWindowManager is a window manager WindowManager object can be passed in the Activity
 mWindowManager = getWindowManager () / / method to obtain, or 
mWindowManager = (WindowManager) context.getSystemService (Context.WINDOW_SERVICE);

No comments:

Post a Comment