Answer the question
In order to leave comments, you need to log in
Why does the listener not work on a tablet and works on a phone?
I have a thread that starts autosound after the start of the activity.
For a phone it looks like this
void Thread(boolean b){
new Handler().postDelayed(new Runnable() {
public void run() {
while (!stopRequested) {
if(MainScreen.tgbutton.isChecked() == false) {
mSoundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
public void onLoadComplete(SoundPool mSoundPool, int sampleId, int status) {
mSoundPool.play(mSlovo, 1, 1, 1, 0, 1);
}
});
stop();
}
else {
stop();
}
}
}
public void stop () {
stopRequested = true;
}
}, 100);
};
void Thread(boolean b){
new Handler().postDelayed(new Runnable() {
public void run() {
while (!stopRequested) {
if(MainScreen.tgbutton.isChecked() == false) {
mSoundPool.play(mSlovo, 1, 1, 1, 0, 1);
stop();
}
else {
stop();
}
}
}
public void stop () {
stopRequested = true;
}
}, 100);
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question