|
@@ -25,6 +25,8 @@ import android.widget.ViewAnimator;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Timer;
|
|
|
+import java.util.TimerTask;
|
|
|
|
|
|
import de.tudarmstadt.informatik.hostage.R;
|
|
|
import de.tudarmstadt.informatik.hostage.sync.wifi_direct.BackgroundTask;
|
|
@@ -116,6 +118,13 @@ public class WiFiP2pSyncActivity extends Activity implements AdapterView.OnItemC
|
|
|
this.registerListeners();
|
|
|
|
|
|
this.wifiEventHandler().startService();
|
|
|
+
|
|
|
+ new Timer().scheduleAtFixedRate(new TimerTask() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ searchForDevices();
|
|
|
+ }
|
|
|
+ }, 1000, 5000); // search for devices every 5 seconds
|
|
|
}
|
|
|
|
|
|
@Override
|