Code example for Stack

Methods: push

0
            @Override 
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                File file = (File) parent.getItemAtPosition(position);
 
                if (file.isDirectory()) {
                    mPrevFolders.push(mCurrentFolder);
                    loadFolder(file);
                } else { 
                    Intent data = new Intent();
                    data.putExtra(EXTRA_FILE_PATH, file.getPath());
                    setResult(Activity.RESULT_OK, data);
                    finish();
                } 
            } 
        }); 
 
        mAdapter = new FilePickerListAdapter(FilePicker.this);
        setListAdapter(mAdapter);
    } 
 
    @Override