我一直在寻找各种教程,但没有人能解决我的问题。我希望这里有一些可以让我理解的东西,关于如何在完成从数据库下载到 android 后自动打开 PDF 文件。这是我的下载脚本。@Overridepublic void onBindViewHolder(HolderData holder, int position) { final ModelData md = mItems.get(position); holder.txtname.setText(md.getName()); holder.txtwaktu.setText(md.getWaktu()); //Proses Downloading holder.relativeLayoutMateri.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { uri = String.valueOf(Uri.parse("http://192.168.43.144/MLearning/crud/"+md.getPath())); dm = (DownloadManager)context.getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager.Request request = new DownloadManager.Request(Uri.parse(uri)); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); longid = dm.enqueue(request); Toast.makeText(context, md.getName()+" Berhasil Di Download"+md.getPath(), Toast.LENGTH_SHORT).show(); } });}
添加回答
举报
0/150
提交
取消