I have a ListView where each row represents content that needs to be upload to a server. Each row contains a Button that when pressed starts an intent service to begin upload to the server.
When first time I press a Button, the intent service starts, but the second time a new intent service does not start ? Should it ? This is the code in onClickListener for my ListView Button.
Intent intent = new Intent(VaultActivity.this, Upload.class);
intent.putExtra(FILEPATH, vidoObject.filePath);
intent.putExtra(POSITION, position);
ListActivity.this.startService(intent);
Am I doing anything wrong? Should the second row button not also create a new IntentService to begin upload ?
An IntentService is actually just a work queue:
So it may be possible that your second row button starts another service, but only if the first upload was already finished.
If you want to upload two files simultaneously you cannot use an IntentService, because it processes one command at a time.