How can I cancel this thread in case a button is pressed under those 15 seconds?
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
try {
sound1.setVolume(1, 1);
} catch (Exception e) {
Log.e("Exception", e.getMessage());
} }
},15000);
What if I have 2 treads each one same like the above? How can I refer to one of them?