<pre style="font-family:'굴림체';font-size:9pt;"> <span style="font-size:9pt;">DownloadManager downloadManager = (DownloadManager) </span><span style="font-size:9pt;">getSystemService(Context.</span><span style="font-size:9pt;color:#660e7a;font-weight:bold;font-style:italic;">DOWNLOAD_SERVICE</span><span style="font-size:9pt;">);</span><span style="font-size:9pt;"> </span></pre><pre style="font-family:'굴림체';font-size:9pt;"> Request request = (Request) <span style="color:#000080;font-weight:bold;">new </span>Request(downloadUri);<br> request.setTitle(fileName);<br> request.setDescription(url);<br> request.setMimeType(mimeType);<br> request.setDestinationInExternalPublicDir( Environment.<span style="color:#660e7a;font-style:italic;">DIRECTORY_DOWNLOADS</span>, fileName);<br> Environment.<span style="font-style:italic;">getExternalStoragePublicDirectory</span>( Environment.<span style="color:#660e7a;font-style:italic;">DIRECTORY_DOWNLOADS</span>).mkdirs();<br><span style="color:#808080;font-style:italic;">// ???? ???? ?? ??<br></span><span style="color:#808080;font-style:italic;"> </span><span style="color:#000080;font-weight:bold;">long </span>id = downloadManager.enqueue( request);</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;">안드로이드에서 <span style="font-size:9pt;">DownloadManager 를 이용해서 파일다운로드할때</span></pre><pre style="font-family:'굴림체';font-size:9pt;"><span style="font-size:9pt;">한번에 여러개의 파일을 다운받으려구할때</span></pre><pre style="font-family:'굴림체';font-size:9pt;"></pre><pre style="font-size:9pt;font-family:'굴림체';"><span style="color:#000080;font-weight:bold;">long </span>id = downloadManager.enqueue( request);</pre><pre style="font-size:9pt;font-family:'굴림체';">id 값이 1 인파일과</pre><pre style="font-size:9pt;font-family:'굴림체';">id 값이 2 인파일을 다운로드했을때</pre><pre style="font-size:9pt;font-family:'굴림체';"><br></pre><pre style="font-size:9pt;font-family:'굴림체';"></pre><pre style="font-family:'굴림체';font-size:9pt;">파일다운로드 완료시 브로드캐스트 레시브에서 </pre><pre style="font-family:'굴림체';font-size:9pt;">어느파일이 다운로드 완료되었는지는 어떻게구분할수있나요?</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;"><span style="color:#000080;font-weight:bold;">private </span>BroadcastReceiver <span style="color:#660e7a;font-weight:bold;">downloadCompleteReceiver </span>= <span style="color:#000080;font-weight:bold;">new </span>BroadcastReceiver() {<br><br><span style="color:#808000;">@Override<br></span><span style="color:#808000;"> </span><span style="color:#000080;font-weight:bold;">public void </span>onReceive(Context context, Intent intent) {</pre><pre style="font-family:'굴림체';font-size:9pt;">DownloadManager.Query query = <span style="color:#000080;font-weight:bold;">new </span>DownloadManager.Query();<br>query.setFilterById(<span style="color:#0000ff;">11</span>);<br><span style="color:#808080;font-style:italic;">//다운로드한 데이터 중 조건이 일치하는 데이터를 검색하여 커서로 반환한다<br></span>Cursor c = dm.query(query);<br><span style="color:#000080;font-weight:bold;">if</span>(c.moveToFirst()){</pre>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.