Blood cases caused by manageSpaceActivity of android

Source: Internet
Author: User

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 withElement.

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.




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.