1
내부 서버에서 자동 업데이트를 개발 중입니다.
다운로드가 제대로 작동하지만 다운로드 한 apk을 설치하려고 할 때 "구문 분석 오류, 패키지 구문 분석 문제"가 발생합니다.android parse error parsing package
private BroadcastReceiver mDownloadReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) {
long downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, 0);
Log.i(VERSION_LOG_TAG, "received download id: " + downloadId);
DownloadManager.Query query = new DownloadManager.Query();
query.setFilterById(enqueue);
Cursor cursor = dm.query(query);
if (cursor.moveToFirst()) {
int columnIndex = cursor.getColumnIndex(DownloadManager.COLUMN_STATUS);
if (DownloadManager.STATUS_SUCCESSFUL == cursor.getInt(columnIndex)) {
String uriString = cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
Log.i(VERSION_LOG_TAG, uriString);
Intent installIntent = new Intent(Intent.ACTION_VIEW);
File apk = new File(Uri.parse(uriString).getPath());
installIntent.setDataAndType(Uri.fromFile(apk), "application/vnd.android.package-archive");
startActivity(installIntent);
}else{
Log.e(VERSION_LOG_TAG, "download failed");
}
}
}
}
};
는 나는 생각의 URL 이유는 내가 잘못합니까 무엇 content://downloads/my_downloads/13
?
을 파일 관리자 응용 프로그램에서 다운로드 한 파일을 열려고 또는 당신은 앱 내에서 직접 파일 URL에 액세스하지 않는 한 전 파일 탐색기를 다운로드 할 수 있습니다 다음 [질문] [1] [1] : http://stackoverflow.com/questions/27404478/android-cant-open-file – NickF