fix string format and context method
authorKeith Abdulla <email@ekeitho.com>
Sat, 20 Dec 2014 04:11:25 +0000 (20:11 -0800)
committerKeith Abdulla <email@ekeitho.com>
Sat, 20 Dec 2014 04:11:25 +0000 (20:11 -0800)
src/com/owncloud/android/operations/CreateShareOperation.java
src/com/owncloud/android/services/OperationsService.java

index 6247c6d..72cbee4 100644 (file)
@@ -133,9 +133,9 @@ public class CreateShareOperation extends SyncOperation {
         OCFile file = getStorageManager().getFileByPath(mPath);
         if (file!=null) {
             mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
         OCFile file = getStorageManager().getFileByPath(mPath);
         if (file!=null) {
             mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
-            mSendIntent.putExtra(Intent.EXTRA_SUBJECT, getClient().getCredentials().getUsername() + " " +
-                    mContext.getString(R.string.shared_subject_header) + " >>" + file.getFileName() + "<< " +
-                    mContext.getString(R.string.with_you_subject_header));
+            mSendIntent.putExtra(Intent.EXTRA_SUBJECT, String.format("%s %s >>%s<< %s",
+                    getClient().getCredentials().getUsername(), mContext.getString(R.string.shared_subject_header),
+                    file.getFileName(), mContext.getString(R.string.with_you_subject_header)));
             file.setPublicLink(share.getShareLink());
             file.setShareByLink(true);
             getStorageManager().saveFile(file);
             file.setPublicLink(share.getShareLink());
             file.setShareByLink(true);
             getStorageManager().saveFile(file);
index a0e671f..ca370b3 100644 (file)
@@ -319,7 +319,7 @@ public class OperationsService extends Service {
                         String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
                         Intent sendIntent = operationIntent.getParcelableExtra(EXTRA_SEND_INTENT);
                         if (remotePath.length() > 0) {
                         String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
                         Intent sendIntent = operationIntent.getParcelableExtra(EXTRA_SEND_INTENT);
                         if (remotePath.length() > 0) {
-                            operation = new CreateShareOperation(getApplicationContext(), remotePath, ShareType.PUBLIC_LINK,
+                            operation = new CreateShareOperation(OperationsService.this, remotePath, ShareType.PUBLIC_LINK,
                                     "", false, "", 1, sendIntent);
                         }
                         
                                     "", false, "", 1, sendIntent);
                         }