Log_OC.i(TAG, "onActivityCreated() stop");
}
+ public void selectAll(){
+ int numberOfFiles = mAdapter.getCount();
+ for(int i = 0; i < numberOfFiles; i++){
+ File file = (File) mAdapter.getItem(i);
+ if (file != null) {
+ if (!file.isDirectory()) {
+ /// Click on a file
+ getListView().setItemChecked(i, true);
+ // notify the change to the container Activity
+ mContainerActivity.onFileClick(file);
+ }
+ }
+ }
+ }
+
+ public void deselectAll(){
+ mAdapter = new LocalFileListAdapter(mContainerActivity.getInitialDirectory(), getActivity());
+ setListAdapter(mAdapter);
+ }
/**
* Checks the file clicked over. Browses inside if it is a directory. Notifies the container activity in any case.
*/
@Override
public void onItemClick(AdapterView<?> l, View v, int position, long id) {
- File file = (File) mAdapter.getItem(position);
+ File file = (File) mAdapter.getItem(position);
+
if (file != null) {
/// Click on a directory
if (file.isDirectory()) {