There is a ProgressBar in my notification that works like this:
new Thread(
new Runnable() {
@Override
public void run() {
int incr;
// Do the "lengthy" operation 20 times
for (incr = 0; incr <= 100; incr += 5) {
// Sets the progress indicator to a max value, the
// current completion percentage, and "determinate"
// state
builder.setProgress(100, incr, false);
// Displays the progress bar for the first time.
m.notify(id, builder.build());
// Sleeps the thread, simulating an operation
// that takes time
try {
// Sleep for 5 seconds
Thread.sleep(5 * 1000);
} catch (InterruptedException e) {
}
}
And the two buttons:
builder.addAction(R.drawable.Continuar, "Continuar", ??);
builder.addAction(R.drawable.Pausar,"Pausar",??);
Would anyone know how to make the buttons pause and summarize Thread?