diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4ed1c0445d..11d6f0b29f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -68,8 +68,8 @@
There are no %1$s accounts on your device. Please set up an account first.
Setup
Quit
- No content to upload
- No content was received. Nothing to upload.
+ No file to upload
+ Sorry, the received data does not content any file.
%1$s is not allowed to access the shared content
Uploading
seconds ago
@@ -99,6 +99,7 @@
Retry upload
Cancel sync
Cancel
+ Back
Save & exit
Error
Loading …
diff --git a/src/com/owncloud/android/ui/activity/Uploader.java b/src/com/owncloud/android/ui/activity/Uploader.java
index 5814066ac4..0bd36860f4 100644
--- a/src/com/owncloud/android/ui/activity/Uploader.java
+++ b/src/com/owncloud/android/ui/activity/Uploader.java
@@ -51,6 +51,7 @@ import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AlertDialog.Builder;
+import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@@ -227,6 +228,17 @@ public class Uploader extends FileActivity
@Override
protected Dialog onCreateDialog(final int id) {
final AlertDialog.Builder builder = new Builder(this);
+ // Create key listener for back button pressed
+ DialogInterface.OnKeyListener onKeyListener = new DialogInterface.OnKeyListener() {
+ @Override
+ public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ finish();
+ dialog.dismiss();
+ }
+ return true;
+ }
+ };
switch (id) {
case DIALOG_WAITING:
final ProgressDialog pDialog = new ProgressDialog(this, R.style.ProgressDialogTheme);
@@ -314,12 +326,13 @@ public class Uploader extends FileActivity
builder.setTitle(R.string.uploader_wrn_no_content_title);
builder.setMessage(R.string.uploader_wrn_no_content_text);
builder.setCancelable(false);
- builder.setNegativeButton(R.string.common_cancel, new OnClickListener() {
+ builder.setNegativeButton(R.string.common_back, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
+ builder.setOnKeyListener(onKeyListener);
return builder.create();
default:
throw new IllegalArgumentException("Unknown dialog id: " + id);