我这样做了,但是不行。FileDialog dialog=new FileDialog(this,"保存",FileDialog.SAVE);
dialog.setFilenameFilter(new ExtName("txt"));
dialog.show();其中ExtName类是这样的:
public class ExtName implements FilenameFilter{
String ext; public ExtName(String e) {
ext="."+e;
} public boolean accept(File dir,String name){
return name.endsWith(ext);
}
}
dialog.setFilenameFilter(new ExtName("txt"));
dialog.show();其中ExtName类是这样的:
public class ExtName implements FilenameFilter{
String ext; public ExtName(String e) {
ext="."+e;
} public boolean accept(File dir,String name){
return name.endsWith(ext);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货