Thanks Google released 2.2 source code.
In this code-InstalledAppDetails.java
It shows how android 2.2 does the "force close" function.
private void forceStopPackage(String pkgName) {
ActivityManager am = (ActivityManager)getSystemService(
Context.ACTIVITY_SERVICE);
am.forceStopPackage(pkgName);
checkForceStop();
}
However "forceStopPackage" method is not in ActivityManager class. http://developer.android.com/reference/android/app/ActivityManager.html
Is it a interneal API? Thanks.