Back to project page garageoPIner-androidApp.
The source code is released under:
Apache License
If you think the Android project garageoPIner-androidApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.wirthual.garageopiner.utils; //from w w w . jav a 2s . c om import android.app.NotificationManager; import android.support.v4.app.NotificationCompat; public class NotificationUpdateRunnable implements Runnable{ NotificationCompat.Builder mBuilder; NotificationManager mNotifyManager; String contentText; String s; int maxtime; public NotificationUpdateRunnable(NotificationCompat.Builder builder, NotificationManager man, int seconds,String content, String second) { this.mBuilder = builder; this.maxtime = seconds; mNotifyManager = man; contentText = content; s = second; } @Override public void run() { int incr; for (incr = 0; incr <= maxtime; incr+=1) { int diff = maxtime - incr; String contentString = contentText +" " + String.valueOf(diff) +" " + s; mBuilder.setProgress(maxtime, incr, false); mBuilder.setContentText( contentString); mNotifyManager.notify(0, mBuilder.build()); try { Thread.sleep(960); } catch (InterruptedException e) { mNotifyManager.cancel(0); return; } } mNotifyManager.cancel(0); } }