|
@@ -275,16 +275,16 @@ public class WiFiP2pSyncActivity extends Activity implements AdapterView.OnItemC
|
|
|
public void didSucceed() {
|
|
|
Toast.makeText(this.activity, SYNCHRONIZATION_COMPLETE_MESSAGE , Toast.LENGTH_SHORT).show();
|
|
|
this.activity.wifiEventHandler().disconnect();
|
|
|
- this.activity.hostTask = null;
|
|
|
- this.activity.clientTask = null;
|
|
|
+ //this.activity.hostTask = null;
|
|
|
+ //this.activity.clientTask = null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void didFail() {
|
|
|
Toast.makeText(this.activity, SYNCHRONIZATION_FAILED_MESSAGE, Toast.LENGTH_LONG).show();
|
|
|
this.activity.wifiEventHandler().disconnect();
|
|
|
- this.activity.hostTask = null;
|
|
|
- this.activity.clientTask = null;
|
|
|
+ //this.activity.hostTask = null;
|
|
|
+ //this.activity.clientTask = null;
|
|
|
}
|
|
|
}.init(this);
|
|
|
}
|
|
@@ -352,16 +352,10 @@ public class WiFiP2pSyncActivity extends Activity implements AdapterView.OnItemC
|
|
|
*/
|
|
|
private void startClient(WifiP2pInfo info)
|
|
|
{
|
|
|
- if (this.clientTask == null){
|
|
|
- Log.d("WiFiP2pSyncActivity", "Starting CLIENT Task" + ".");
|
|
|
- //Toast.makeText(this, PERFORMING_TASK_AS_CLIENT, Toast.LENGTH_SHORT).show();
|
|
|
- this.clientTask = new SyncClientTask( info.groupOwnerAddress.getHostAddress(),this.ownDevice, this.syncCompletionListener(), getApplicationContext() );
|
|
|
- this.executingTask = this.clientTask;
|
|
|
- this.clientTask.execute();
|
|
|
- } else {
|
|
|
- Log.d("WiFiP2pSyncActivity", "Preventing third device for syncing" + ".");
|
|
|
- }
|
|
|
-
|
|
|
+ Log.d("WiFiP2pSyncActivity", "Starting CLIENT Task" + ".");
|
|
|
+ this.clientTask = new SyncClientTask( info.groupOwnerAddress.getHostAddress(),this.ownDevice, this.syncCompletionListener(), getApplicationContext() );
|
|
|
+ this.executingTask = this.clientTask;
|
|
|
+ this.clientTask.execute();
|
|
|
}
|
|
|
|
|
|
/**
|