소스 검색

fix string format and context method

Keith Abdulla 10 년 전
부모
커밋
38d0a19307
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 3
      src/com/owncloud/android/operations/CreateShareOperation.java
  2. 1 1
      src/com/owncloud/android/services/OperationsService.java

+ 3 - 3
src/com/owncloud/android/operations/CreateShareOperation.java

@@ -133,9 +133,9 @@ public class CreateShareOperation extends SyncOperation {
         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);

+ 1 - 1
src/com/owncloud/android/services/OperationsService.java

@@ -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) {
-                            operation = new CreateShareOperation(getApplicationContext(), remotePath, ShareType.PUBLIC_LINK,
+                            operation = new CreateShareOperation(OperationsService.this, remotePath, ShareType.PUBLIC_LINK,
                                     "", false, "", 1, sendIntent);
                         }