Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void markerUpdate() {
- Handler mainHandler = new Handler(Looper.getMainLooper());
- MapsActivity.this.runOnUiThread(() -> {
- TimerTask timerTask = new TimerTask() {
- @RequiresApi(api = Build.VERSION_CODES.O)
- @Override
- public void run() {
- Runnable myRunnable = () -> {
- try {
- GetUrlContentTask.cleanMap();
- }catch (NullPointerException e){
- e.printStackTrace();
- }};
- mainHandler.post(myRunnable);
- new GetUrlContentTask().execute("https://www.stops.lt/klaipeda/gps.txt?1548774463");
- // new GetUrlContentTask().execute("https://www.stops.lt/klaipeda/gps.txt?"+ String.valueOf(Instant.now().getEpochSecond()));
- }
- };
- new Timer().schedule(timerTask,50,10000);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement