Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

When I go to Settings > Applications > Manage Applications > Downloaded I see an application list. If I select some applications I see button "Force stop" active, but some applications have this button dimmed.

What does it mean? What happens if I press this button?

This button can't mean application running, since the applications with this button are not listed in Running section.

Can I list just applications which have the Force stop button active and uninstall them?


Android version: 3.2

share|improve this question
add comment

4 Answers 4

As said in my comment to paco's answer, the information he gave is mostly correct: Most apps don't exit completely if you leave them, and no app should exit if you leave it via the "Home" button. Moreover, some apps have background services running which the user otherwise cannot quit.

Now there are some situations where you need an app (including its background services) to be stopped -- e.g. if you want to uninstall that app (or, in case of a system app, its updates). You will notice this when the "Force Stop" button is active, the "Uninstall" (or "Remove") button is grayed out -- but the latter gets activated when you stopped the app via "Force Stop". (If both buttons are grayed out, you can tell it's a system app, by the way -- which you cannot uninstall).

Btw: If the "Force Stop" button is grayed out ("dimmed" as you put it) it means that app is not currently running, nor has it any service running (at that moment).

share|improve this answer
add comment

Android maintains 4 types of applications in its memory. I dont remember all but running and cached background are 2 of them...(cached background can be accessed by clicking the hardware menu button when in the running tab and selecting the poped up option)

So though it might not be seen in the running processes, it is not entirely dead.

Mostly it shall be in the cached background prcesses.

also, about task managers..Its is not advised to use them as android has been hardcoded to manage apps efficiently.App/Task killers actually rather drain battery as after the killer kills apps, acording to the algorithm android follows,they will be started again!(and apps take up rather more memory at startup than in ideal state) thus it becomes a cycle and drains the battery.

so the force close button is active on mostly running and cached processes and may exist on a very few apps that reside in the other two types of processes!

on other apps its greyd out!

share|improve this answer
    
It's more than 4 types (see Understanding Android Application and Activity Lifecycles for a closer explanation). But those classes have nothing to do with the "force stop" button, at least not directly (see my answer: an active "force stop" button simply means that either the app itself or one of its registered services is currently running). –  Izzy Nov 21 '12 at 10:51
add comment

The code behind the Force stop button is complex and undocumented. I'll reproduce it verbatim and then go through it one piece at a time.

private void checkForceStop() {
    if (mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
        // User can't force stop device admin.
        updateForceStopButton(false);
    } else if ((mAppEntry.info.flags&ApplicationInfo.FLAG_STOPPED) == 0) {
        // If the app isn't explicitly stopped, then always show the
        // force stop button.
        updateForceStopButton(true);
    } else {
        Intent intent = new Intent(Intent.ACTION_QUERY_PACKAGE_RESTART,
                Uri.fromParts("package", mAppEntry.info.packageName, null));
        intent.putExtra(Intent.EXTRA_PACKAGES, new String[] { mAppEntry.info.packageName });
        intent.putExtra(Intent.EXTRA_UID, mAppEntry.info.uid);
        intent.putExtra(Intent.EXTRA_USER_HANDLE, UserHandle.getUserId(mAppEntry.info.uid));
        getActivity().sendOrderedBroadcast(intent, null, mCheckKillProcessesReceiver, null,
                Activity.RESULT_CANCELED, null, null);
    }
}

The first if line checks if any component of the package is a device admin (that is, if it's checked in the Device administrators list in the Security page of the Settings app). If so, the button is disabled (greyed out) so you can't stop device admins.

Then, the else if checks if the package is already stopped. Here, stopped doesn't just mean "not running". As far as I can tell, a package is in the stopped state if you've never run any component from it (such as by launching it from the menu), or if you've pressed a Force stop button (this one or in a "stopped working" dialog) and not run any of its components again. If the package hasn't been stopped, the button is enabled.

The else case covers the rare eventuality that an app has been stopped and isn't a device admin. In this case, it gives other system services a chance to enable the button. For example, the app might have an alarm set and pending, which would later cause the app to be started again even from the stopped state. In this case, the button will be enabled. If no other system service has a reason to enable the button, it will be disabled.

Summary

The Force stop button is enabled if the package is not a device admin and either you haven't already force-stopped this app or you have force-stopped it but a system service thinks it will run it again.

If the app is running (and it isn't a device admin), the Force stop button will definitely be enabled, but the button being enabled doesn't mean the app is running.

share|improve this answer
add comment

This button is active for apps that are running or are be running since the last time that you started your device.

Android do not kill the apps totally when you exit from it, this button is for close completely the app and remove it from the stack (apps running), also this button free the memory used by the app.

There is no way to list the apps running, also the apps running in background have this button.

There are free killer apps in the Play Store, to manage the memory of your device automatically.

share|improve this answer
3  
While the basic information is correct: better remove the part about the "automatic killers". There might have been some time when they were needed (before Android 2.x), but they are absolutely contra-productive and mostly have a negative effect on battery runtime. –  Izzy Nov 20 '12 at 21:40
    
I do agree with @Izzy... –  Sachin Shekhar Nov 21 '12 at 5:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.