Mtk8382/8121 platform.
After the machine (8-inch, default portrait screen) is burned for the first time, it starts in a horizontal position and finds that the launcher does not have an icon, but the portrait screen does not have this problem. During the test, we found that this problem also exists after setting clear data. Therefore, it can be preliminarily determined that it is a database initialization problem, because the database stores the data of favorite icon and workspace.
Compared with the database, it is found that the workspaces field is not written. View the output log and find that the biggest difference is that during the initialization process of step 1
setApplicationContext called [email protected] new[email protected]
. Find the location of the warning output and find it in oncreate. That is to say, during the initialization process, launcher3 oncreate twice.
We know that in order to re-layout, the launcher will re-create oncreate each screen conversion. When the screen is placed on a horizontal screen, the screen is converted again in a short time in the default vertical screen state.
After reading androidmanifest. XML, we found that the Android: screenorientation attribute is nosensor, so each start is default (portrait screen ). After changing to sensor, if the first initialization direction is the same as the actual direction, oncreate () will not be executed twice.
In launchermodel. Java, search "Step 1" to find the process of initializing the workspace. This workspace Initialization is not protected by synchronized.
Launcher3 no icon Problems