Android子类中的IBinder

时间:2014-08-19 12:45:34

标签: java android interface

我想问一下IBinder如何支持远程对象的基本接口。因此,它的功能如何适用于以下代码中的CountDownTimer?

  public class BackgroundProcessingService extends Service {

    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
     timer = new CountDownTimer(5 *60 * 1000, 1000) {

            public void onTick(long millisUntilFinished) {
               //Some code
                //inactivity = true;
                timer.start();
                Log.v("Timer::", "Started");
            }

            public void onFinish() {
               //Logout
                Intent intent = new Intent(LoginActivity.this,HomePageActivity.class);
                startActivity(intent);
                //inactivity = false;
                timer.cancel();
                Log.v("Timer::", "Stoped");
            }
         };
        return null;
    }

}

0 个答案:

没有答案