Relative Content

Tag Archive for javaandroidmultithreading

Am I using Thread class correctly here?

private static class StopRecListenerThread extends Thread { SpeechRecognizer recognizer; StopRecListenerThread(SpeechRecognizer recognizer) { this.recognizer = recognizer; } @Override public void run() { if (!this.recognizer.stop()) Log.d(TAG, “StopRecListenerThread: listener was not stopped”); else Log.d(TAG, “StopRecListenerThread: listener was stopped”); } } I have an object that needs to be stopped but it can’t be done on the main thread. […]