Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1.     @Override
  2.     protected void onResume() {
  3.         super.onResume();
  4.         updateTimer = new Timer();
  5.         updateTimer.schedule(new updateTask(new Handler(),this),0,1000);
  6.         dataSource.open();
  7.         AdjustTimers();
  8.         CheckTimers();
  9.  
  10.     }
  11.     public void update() {
  12.         Log.i("DEBUG", "Updating layout");
  13.     }
  14.     private class updateTask extends TimerTask {
  15.         Handler handler;
  16.         ActionBarActivity ref;
  17.  
  18.         public updateTask(Handler handler,ActionBarActivity ref) {
  19.             super();
  20.             this.handler = handler;
  21.             this.ref = ref;
  22.         }
  23.  
  24.         @Override
  25.         public void run() {
  26.             handler.post(new Runnable() {
  27.                 public void run() {
  28.                     ref.update(); //cannot find method
  29.                 }
  30.             });
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement