如何删除列表视图文件浏览器输入和视频文件?视图、视频文件、浏览器、文件

2023-09-12 08:16:19 作者:清风伴烈酒

问题描述:我想要一个删除功能,可以进行删除/删除列表视图中选择的条目,并在同一时间删除Video_List目录中的居住视频文件字符串则刷新列表视图的内容?

Problem description: I wanted a "delete" function which could perform delete/remove of the selected entry in a listview and at the same time delete the residing video file string in the Video_List directory then it refresh the content of the listview?

我是比较新的Andr​​oid中/ Java的有人可以帮助我呢?不要向下滚动评价我面对,请问题!谁能告诉我具体是什么$ C $词应该加入到我目前的codeS执行上述提到的功能??

I'm rather new in android/java can someone help me with it? Do scroll down to evaluate the problem i'm facing please!! Can someone tell me what is the specific code i should add into my current codes to perform the above mention function??

推荐答案

既然你已经储存在您选择到项,你需要从该对象retreive的文件路径,对于工作中添加DELETEFILE对象则()方法行:

Since you have stored your selection into "item" object then in deleteFile() method you need to retreive the file path from that object, for that to work add the line:

model.absolutePath =   mfile.getAbsolutePath();

model.absolutePath = mfile.getAbsolutePath();

在getVideoFiles()方法中的for循环。

in getVideoFiles() method 'for' loop.

还的onCreate状态之前:

also before onCreate state:

ListViewAdapter LV;

ListViewAdapter lv;

然后getVideoFiles在结束状态:

then in getVideoFiles at the end state:

  lv = new ListViewAdapter(this, R.layout.row, videoItems);
  setListAdapter(lv); 

终于在DELETEFILE(),你需要状态:

finally in deleteFile() you need to state:

myfile文件=新的文件(item.absolutePath);

Excel 如何删除IE缓存中的文件

File myFile = new File(item.absolutePath);

lv.notifyDataSetChanged();

lv.notifyDataSetChanged();

和应该努力!