Code example for File

Methods: getName, getPath, isDirectory

0
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
    } 
 
    boolean fileFilter(File f) {
    	if (f.getName().startsWith("."))
    		return false; 
    	if (f.getName().equalsIgnoreCase("resources"))
    		return false; 
    	if (f.isDirectory())
    		return true; 
    	if (f.getPath().toLowerCase().endsWith("ml"))
    		return true; 
    	return false; 
    } 
 
    void processFile(String filename, boolean selection) {
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setClass(this, TestShellActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        intent.putExtra(TestShellActivity.TEST_URL, "file://" + filename);