Log based demonstration of Android programming detailed explanation of an activity life cycle example

This article illustrates an activity life cycle of Android programming based on log demonstration. Share with you for your reference, as follows:

Use Android's log to demonstrate the life cycle of an activity

code:

This is the result of the demonstration

Using log to show the life cycle of activity

The annotation indicates that the operation performed in the middle is a convenient observation data. It can create a filter on the right side of the LOGCAT window (no show can be transferred in the window menu), click the plus sign to create a filter. In my example, demo is filtered by show.

In addition, the following methods are used to filter and view logs:

example

The five circles can filter five different logs

Pay attention to the green plus sign on the right. Click to customize your own filter. Just name it casually

Select the filter rule you want to create in the by log tag column. For example, if you want to filter out the log with tag marked "yourdemo", you can enter yourdemo in it

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>