Browse Source

Fix bug that produce crash due to multiple touch on upload

tags/release-v2.6
Schoumi 2 years ago
parent
commit
0e75b7c464
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java

+ 7
- 0
app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java View File

@@ -74,6 +74,7 @@ public class UploadActivity extends AppCompatActivity {
private List<Integer> deletedDays;
private ProgressDialog progressDialog;
private ImageListAdapter adapter;
private boolean uploadInProgress;

//static value to handle storage durations options
private static final int NEVER = 0;
@@ -86,6 +87,7 @@ public class UploadActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.upload);
uploadInProgress = false;

Toolbar toolbar = (Toolbar) findViewById(R.id.upload_toolbar);
setSupportActionBar(toolbar);
@@ -230,6 +232,7 @@ public class UploadActivity extends AppCompatActivity {

@Override
public void allFileUploaded() {
uploadInProgress = false;
runOnUiThread(new Runnable() {
@Override
public void run() {
@@ -452,6 +455,9 @@ public class UploadActivity extends AppCompatActivity {
}

private void uploadImages(List<Uri> imageUris) {
if(uploadInProgress)
return;
uploadInProgress = true;
//what server we use
Spinner urlSpinner = (Spinner)findViewById(R.id.servers_spinner);
int pos = urlSpinner.getSelectedItemPosition();
@@ -462,6 +468,7 @@ public class UploadActivity extends AppCompatActivity {
Toast.makeText(UploadActivity.this, getString(R.string.server_list_error), Toast.LENGTH_LONG).show();
}
});
uploadInProgress = false;
return;
}
String url = urls.get(pos);

Loading…
Cancel
Save