Browse Source

Show null path in uploads view

masensio 9 years ago
parent
commit
2ec9899060

+ 1 - 0
src/com/owncloud/android/ui/activity/FileActivity.java

@@ -1005,6 +1005,7 @@ public class FileActivity extends AppCompatActivity
                 case 2: // Uploads
                     Intent uploadListIntent = new Intent(getApplicationContext(),
                             UploadListActivity.class);
+                    uploadListIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                     startActivity(uploadListIntent);
                     mDrawerLayout.closeDrawers();
                     break;

+ 2 - 3
src/com/owncloud/android/ui/activity/UploadListActivity.java

@@ -28,7 +28,6 @@ import android.content.ServiceConnection;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
-import android.os.Parcelable;
 import android.support.v4.view.GravityCompat;
 import android.view.Menu;
 import android.view.MenuInflater;
@@ -125,7 +124,7 @@ public class UploadListActivity extends FileActivity implements UploadListFragme
     private void openPreview(OCUpload file) {
      // preview image
         Intent showDetailsIntent = new Intent(this, PreviewImageActivity.class);
-        showDetailsIntent.putExtra(EXTRA_FILE, (Parcelable)file.getOCFile());
+        showDetailsIntent.putExtra(EXTRA_FILE, file.getOCFile());
         showDetailsIntent.putExtra(EXTRA_ACCOUNT, getAccount());
         startActivity(showDetailsIntent);  
     }
@@ -134,7 +133,7 @@ public class UploadListActivity extends FileActivity implements UploadListFragme
     private void openDetails(OCUpload file) {
         OCFile ocFile = file.getOCFile();
         Intent showDetailsIntent = new Intent(this, FileDisplayActivity.class);
-        showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, (Parcelable) ocFile);
+        showDetailsIntent.putExtra(FileActivity.EXTRA_FILE, ocFile);
         showDetailsIntent.putExtra(FileActivity.EXTRA_ACCOUNT, file.getAccount(this));
         startActivity(showDetailsIntent);
     }

+ 1 - 1
src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java

@@ -174,7 +174,7 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
             
             TextView localPath = (TextView) view.findViewById(R.id.upload_local_path);
             String path = upload.getOCFile().getStoragePath();
-            path = path.substring(0, path.length() - file.length() - 1);
+            path = path == null ? "" : path.substring(0, path.length() - file.length() - 1);
             localPath.setText("Path: " + path);
 
             TextView fileSize = (TextView) view.findViewById(R.id.upload_file_size);