public void openMedia(String fileFullPath) {
File file = new File(fileFullPath);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
try{
DataWarehouse.mainActCtx.startActivity(intent);
DataWarehouse.mainActivityHandler.obtainMessage( FixValue.ACT_CLOSE_FINISH ).sendToTarget();
}catch(ActivityNotFoundException e){
Toast.makeText( DataWarehouse.mainActCtx, DataWarehouse.mainActCtx.getText(R.string.notapp), Toast.LENGTH_SHORT ).show();
e.printStackTrace();
}
}
해결: intent를 시작한 후에, 앱 종료 명령을 줘야 한다.
앱을 교체하는데, 이전 앱이 죽지 않아 생기는 오류같다.
이전 앱에서 새로운 버전의 같은 앱을 설치해 줄 때는 apk파일을 실행 시킨 후 자신은 종료시켜야 한다.
'IT Data > #Android' 카테고리의 다른 글
노트8.0 루팅 / 킷캣 외장메모리 쓰기 (0) | 2014.11.01 |
---|---|
ADB SHELL 명령어 (0) | 2013.11.08 |
# 안드로이드 소켓 통신 (노트북 - 단말기) (0) | 2013.03.04 |
안드로이드 ICS 4.0.3 이클립스로 미리보기. (0) | 2012.01.08 |
스마트폰 설치 후 필수어플! (안드로이드) (0) | 2011.07.02 |