public void onServiceConnected(ComponentName className, IBinder service) {\r
mDownloaderBinder = (FileDownloaderBinder) service;\r
// a new chance to get the mDownloadBinder through getDownloadBinder() - THIS IS A MESS\r
- mFileList.listDirectory();\r
+ if (mFileList != null)\r
+ mFileList.listDirectory();\r
if (mDualPane) {\r
FileDetailFragment fragment = (FileDetailFragment) getSupportFragmentManager().findFragmentByTag(FileDetailFragment.FTAG);\r
if (fragment != null)\r
fragment.updateFileDetails();\r
}\r
- \r
}\r
\r
@Override\r
*/
public void listDirectory(OCFile directory) {
DataStorageManager storageManager = mContainerActivity.getStorageManager();
+ if (storageManager != null) {
- // Check input parameters for null
- if(directory == null){
- if(mFile != null){
- directory = mFile;
- } else {
- directory = storageManager.getFileByPath("/");
- if (directory == null) return; // no files, wait for sync
+ // Check input parameters for null
+ if(directory == null){
+ if(mFile != null){
+ directory = mFile;
+ } else {
+ directory = storageManager.getFileByPath("/");
+ if (directory == null) return; // no files, wait for sync
+ }
}
- }
- // If that's not a directory -> List its parent
- if(!directory.isDirectory()){
- Log.w(TAG, "You see, that is not a directory -> " + directory.toString());
- directory = storageManager.getFileById(directory.getParentId());
- }
+ // If that's not a directory -> List its parent
+ if(!directory.isDirectory()){
+ Log.w(TAG, "You see, that is not a directory -> " + directory.toString());
+ directory = storageManager.getFileById(directory.getParentId());
+ }
- mFile = directory;
- mAdapter.swapDirectory(mFile);
- mList.setSelectionFromTop(0, 0);
- mList.invalidate();
+ mFile = directory;
+ mAdapter.swapDirectory(mFile);
+ mList.setSelectionFromTop(0, 0);
+ mList.invalidate();
+ }
}