本文介绍了如何删除列表视图文件浏览器输入和视频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题描述:我想要一个删除功能,可以进行删除/删除列表视图中选择的条目,并在同一时间删除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();

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

in getVideoFiles() method 'for' loop.

还的onCreate状态之前:

also before onCreate state:

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);

lv.notifyDataSetChanged();

lv.notifyDataSetChanged();

和应该努力!

这篇关于如何删除列表视图文件浏览器输入和视频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 23:01