It's a simple question, but it's always a bit of a problem to use after a certain amount of time. Here is a note of the Logcat steps:
1, in the activity to affirm the tag variable (name is actually casual, as follows:
private static final String tag= "Yan";
2, when you need to use Logcat output information:
LOG.I (Tag, "screen width:" +display.getwidth () + "screen height:" +display.getheight ());
3, double click Logcat, click "+"
add a new logcat filter, a total of
three places need to write information. respectively is logcat filter corresponding to the LOG.I, by the log tag corresponds to Yan (tag's content, and the above corresponds), by the log level to select info (this is the above with Log.i,i on behalf of the meaning of info). Screenshot below:
Then you can debug the program by printing information! If logcat is not open, click window---show view----other--android---logcat to choose from.
Note: If the LOGCAT information is still not visible after a few steps, it is sometimes because the verbose or info in the following image is not selected (that is, the corresponding to you above, my picture is verbose).