projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OC-2887: Fix bug, refresh share icon, share menu refresh
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
ui
/
activity
/
FileActivity.java
diff --git
a/src/com/owncloud/android/ui/activity/FileActivity.java
b/src/com/owncloud/android/ui/activity/FileActivity.java
index
5b5de5b
..
28f7875
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileActivity.java
@@
-160,18
+160,19
@@
public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
@Override
protected void onStop() {
super.onStop();
@Override
protected void onStop() {
super.onStop();
- if (mOperationsServiceBinder != null) {
- mOperationsServiceBinder.removeOperationListener(this);
- mOperationsServiceBinder = null;
- }
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onDestroy() {
super.onDestroy();
- if (mOperationsServiceConnection != null)
+ if (mOperationsServiceConnection != null) {
+ if (mOperationsServiceBinder != null) {
+ mOperationsServiceBinder.removeOperationListener(this);
+ mOperationsServiceBinder = null;
+ }
unbindService(mOperationsServiceConnection);
unbindService(mOperationsServiceConnection);
+ }
}
}
@@
-393,6
+394,8
@@
public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) {
dismissLoadingDialog();
if (result.isSuccess()) {
private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) {
dismissLoadingDialog();
if (result.isSuccess()) {
+ updateFileFromDB();
+
Intent sendIntent = operation.getSendIntent();
startActivity(sendIntent);
Intent sendIntent = operation.getSendIntent();
startActivity(sendIntent);
@@
-410,10
+413,13
@@
public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) {
dismissLoadingDialog();
private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) {
dismissLoadingDialog();
- if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { // Error --> SHARE_NOT_FOUND
+ if (result.isSuccess()){
+ updateFileFromDB();
+
+ } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { // Error --> SHARE_NOT_FOUND
Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_no_exist), Toast.LENGTH_LONG);
t.show();
Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_no_exist), Toast.LENGTH_LONG);
t.show();
- } else
if (!result.isSuccess())
{ // Generic error
+ } else { // Generic error
// Show a Message, operation finished without success
Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_error), Toast.LENGTH_LONG);
t.show();
// Show a Message, operation finished without success
Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_error), Toast.LENGTH_LONG);
t.show();
@@
-421,6
+427,14
@@
public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
}
}
+
+ private void updateFileFromDB(){
+ OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath());
+ if (file != null) {
+ setFile(file);
+ }
+ }
+
/**
* Show loading dialog
*/
/**
* Show loading dialog
*/