2011-03-14 5 views
0

Android 설명서를 확인하면 이러한 방법이 존재하지 않습니다. 그러나 응용 프로그램 관리자 (the built in one)에 대한 소스 코드에서 찾고 그것을 사용PackageManager.movePackage()는 어디에 있습니까?

mPm.movePackage(mAppEntry.info.packageName, mPackageMoveObserver, moveFlags); 

movePackage() 방법, looking in the source code이 (2.2 프로 요, API 용) 등의 방법이 있고 public abstract로 선언하면서. 나는이 방법에 어떻게 접근 할 수 있을까?

+0

왜이 방법을 액세스 할 않는다 ? 유스 케이스가 보이지 않으며 패키지를 이동할 수 있어야한다고 생각하지 않습니다. 그것은 OS가 돌봐야 만하는 것처럼 보입니다. –

+0

앱을 대량으로 SD 카드에 옮기고 싶습니다. 그것은 꽤 오랫동안 나를 괴롭혔습니다. – xandy

답변

0

movePackage

공개 추상 무효 movePackage (문자열 여기서 packageName은, android.content.pm.IPackageMoveObserver 관찰자, INT 플래그)

Attempts to move package resources from internal to external media or vice versa. Since this may take a little while, the result will be posted back to the given observer. This call may fail if the calling context lacks the Manifest.permission.MOVE_PACKAGE permission, if the named package cannot be found, or if the named package is a "system package". 

Parameters: 
    packageName - The name of the package to delete 
    observer - An observer callback to get notified when the package move is complete. android.content.pm.IPackageMoveObserver#packageMoved(boolean) will be called when that happens. observer may be null to indicate that no callback is desired. 
    flags - To indicate install location MOVE_INTERNAL or MOVE_EXTERNAL_MEDIA