I have a thread:
public class KelvinThread implements Runnable {
private Handler mSoundHandler;
public KelvinThread() {
super();
mSoundHandler = new Handler();
}
private Runnable mSoundThread = new Runnable() {
public void run() {
// my treatment
}
};
@Override
public void run() {
while (true) {
// ....
mSoundHandler.postDelayed(mSoundThread, 2000);
// ....
}
}
This thread "KelvinThread" is created and started from another Thread.
I have this error:
Can't create handler inside thread that has not called Looper.prepare()
when my handler is allocated : mSoundHandler = new Handler();
Thank you for your help guys !