Preface:
First of all, read this article to know what the property of android: manageSpaceActivity is. This attribute is defined during application. This attribute specifies an Activity for data clearing. In this way, developers can specify to users that the data is used for clearing. Otherwise, by default, all are cleared. Let's take a look at the original description:
The fully qualified name of an Activity subclass that the system can launch to let users manage the memory occupied by the application on the device. The activity shoshould also be declared with
Element.
A bug occurred on the phone a few days ago (as described below ):
Go to "application" and select an application from the Application List to enter the application information. Some applications have the "enable and disable" button, and there is a "manage space" button below. After you select the "stop" button here, if you select the "manage space" button below, the stop operation will appear. Open the LOG information and you will find the following error (here I use the built-in "Baidu Browser" for analysis ):
01-01 00:02:54. 016: D/dalvikvm (1021): GC_FOR_ALLOC freed 1293 K, 11% free 11946 K/13284 K, paused 26 ms, total 26 ms
01-01 00:02:54. 017: E/AndroidRuntime (1021): fatal exception: main
01-01 00:02:54. 017: E/AndroidRuntime (1021): android. content. activityNotFoundException: Unable to find explicit activity class {com. baidu. browser. apps/com. baidu. browser. settings. bdManageSpaceActivity}; have you declared this activity in your AndroidManifest. xml?
01-01 00:02:54. 017: E/AndroidRuntime (1021): at android. app. Instrumentation. checkStartActivityResult (Instrumentation. java: 1627)
From the preceding error message, we can clearly understand that the system calls an Activity that cannot be found. We also recommend that you check whether the AndroidManifest. xml of this app is configured. From this error message, we can quickly learn the result: "Baidu Browser" is definitely a problem with this APP. Specifically, this APP's Activity: BdManageSpaceActivity has a problem, either not registered, or not registered, or this Activity does not exist. But what I want to say is: this is not the case!
To locate the problem, first confirm whether the BdManageSpaceActivity of the APP "Baidu Browser" is OK. The biggest drop is that AndroidManifest. xml is defined as OK, and BdManageSpaceActivity. java is also correct. The following is the declaration of BdManageSpaceActivity in AndroidManifest. xml:
In this way, "Baidu Browser" is indeed OK. In fact, after analysis, I have understood some truth: I initially suspected that the problem with "Baidu Browser" was caused by the above error message, this error message misled me. In fact, it should have been possible to think of "Baidu Browser", because "Stopping" occurs when other apps undergo unusual operations, the normal operation is normal. Since the "Baidu Browser" BdManageSpaceActivity can be normally enabled, it indicates that the "Baidu Browser" BdManageSpaceActivity is normal.
Now let's analyze Step 2: Let's see what the "Application Management" APP in the settings has done in the "disabled" Baidu browser?
mPm.setApplicationEnabledSetting(mInfo.packageName, mState, 0);
MState = PackageManager. COMPONENT_ENABLED_STATE_DEFAULT,
In this way, the APP will be suspended and it will not be available in Luncher, and all activities of the APP will be terminated. Therefore, it is impossible to find an Activity that calls the disabled APP through "manage space.