0
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",??);
Someone would know how to make the buttons pause and summarize the Thread?
Ah, thank you very much, but one thing, I don’t quite understand how to change this by the Notification buttons, because I can only get them to open new Classes...
– Jamile9797