小编Teh*_*ohn的帖子

CountDownTimer结束时的通知

我正在尝试通知告诉我,我CountDownTimer已经结束了,但我遇到了一些麻烦.目前我已经建立了一个测试通知(我认为)但我不知道如何呼吁通知工作.这就是我现在所拥有的:

public void onFinish() {
      NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(TestTimer.this);
      mBuilder.setContentTitle("Notification Alert, Click Me!");
      mBuilder.setContentText("Hi, This is Android Notification Detail!");
     TextView timer=(TextView)findViewById(R.id.mTextField);
    timer.setText("Seconds remaining: 0 ")
Run Code Online (Sandbox Code Playgroud)

一旦timer = 0就调用它,我想知道是否可以在它发出通知时调用它.

在此先感谢您的帮助,如果您需要更多代码,请随时提出.

notifications android

0
推荐指数
1
解决办法
761
查看次数

标签 统计

android ×1

notifications ×1